请问,下列错误是什么原因?

zwliu 2004-08-20 02:42:27
连接SQL SERVER2000时
<%
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=ctmsnew";
String user="sa";
String password="";
Connection con=DriverManager.getConnection(url,user,password);
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs;
rs=stmt.executeQuery("select us_logid,us_name,us_password from suser");
%>



Error: 500
Location: /myjsp/getdata.jsp
Internal Servlet Error:

org.apache.jasper.compiler.ParseException: C:\jakarta-tomcat-3.2.3\webapps\ROOT\myjsp\getdata.jsp(0,33) Attribute value should be quoted

...全文
55 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoshu97 2004-08-20
  • 打赏
  • 举报
回复
上面的不知道,但下面的好象是。警告变量可能没有初始化就使用。
zwliu 2004-08-20
  • 打赏
  • 举报
回复
谢谢,我在标签的属性里加""后,还是上述代码,编译运行时出现:
Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
C:\jakarta-tomcat-3.2.3\work\localhost_8080\_0002fmyjsp_0002fgetdata_0002ejspgetdata_jsp_0.java:68: Ambiguous class: java.beans.Statement and java.sql.Statement
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
^
C:\jakarta-tomcat-3.2.3\work\localhost_8080\_0002fmyjsp_0002fgetdata_0002ejspgetdata_jsp_0.java:70: Variable stmt may not have been initialized.
rs=stmt.executeQuery("select us_logid,us_name,us_password from suser");
^
2 errors, 1 warning

什么原因啊,高手请指点
hanic 2004-08-20
  • 打赏
  • 举报
回复
不是链接数据库的问题

而是getdata.jsp里标签的属性要用""

比如:<html:text name="aa" property="ddd"/>
不能写成<html:text name=aa property=ddd/>
stevenson1017 2004-08-20
  • 打赏
  • 举报
回复
jsp有错误,贴上来看看

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧