- 论坛徽章:
- 0
|
本帖最后由 user2003 于 2011-10-19 23:44 编辑
例如:
创建一个表:
create table t1 (name nchar(20), id int)
插入数据:
insert into t1 (name, id) values('张三‘,2)
执行成功后,可以用id查到本条记录(正确显示),但用name查询时,结果为空。
经Google,影响此问题的原因可能出现在以下任一环节,但如何排除和解决。
网页->JSP->JAVA(Servelet)->数据库 ...->Servelet->JSP->网页
////////////////=======================
当前还有一个现象,可能与此有关
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:if test="${sqlStatement == null}">
<c:set var="sqlStatement" value="select * from 用户" />
</c:if>
<h1>The SQL Gateway</h1>
<p>Enter an SQL statement and click the Execute button. Then, information about the <br>
statement will appear at the bottom of this page.</p>
<p>
<b>SQL statement:</b><br>
<form action="sqlGateway" method="post">
<textarea name="sqlStatement" cols="60" rows="8">${sqlStatement}
</textarea><br><br>
<input type="submit" value="Execute">
</form>
</p>
红色部分是定义一个变量的初始值,含中文。启动时可以正确显示。
当提交form后,应回显这个变量的值。但实际却显示乱码。 |
|