jsp连数据库总是出错误?如果写个日期能正常显示。什么原因,给50分啊!

qdlg 2003-12-15 04:09:46
错误显示页:


HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
[javac] Compiling 1 source file

C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:47: illegal character: \12288



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
????String url="jdbc:microsoft:sqlserver://localhost:8080;DatabaseName=pubs";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:47: illegal character: \12288



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
????String url="jdbc:microsoft:sqlserver://localhost:8080;DatabaseName=pubs";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:49: illegal character: \12288
????//pubs涓轰?????????
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:49: illegal character: \12288
????//pubs涓轰?????????
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:50: illegal character: \12288
????String user="sa";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:50: illegal character: \12288
????String user="sa";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:51: illegal character: \12288
????String password="";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:51: illegal character: \12288
????String password="";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:52: illegal character: \12288
????
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:52: illegal character: \12288
????
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:53: illegal character: \12288
????Connection conn= DriverManager.getConnection(url,user,password);
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:53: illegal character: \12288
????Connection conn= DriverManager.getConnection(url,user,password);
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:54: illegal character: \12288
????Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:54: illegal character: \12288
????Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:55: illegal character: \12288
????String sql="select * from authors";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:55: illegal character: \12288
????String sql="select * from authors";
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:56: illegal character: \12288
????ResultSet rs=stmt.executeQuery(sql);
^



An error occurred at line: 4 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:56: illegal character: \12288
????ResultSet rs=stmt.executeQuery(sql);
^



An error occurred at line: 15 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:57: illegal character: \12288
????while(rs.next()) {
^



An error occurred at line: 15 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:57: illegal character: \12288
????while(rs.next()) {
^



An error occurred at line: 20 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:68: illegal character: \12288
????stmt.close();
^



An error occurred at line: 20 in the jsp file: /2222.jsp

Generated servlet error:
C:\tomcat\work\Standalone\localhost\_\_2222_jsp.java:68: illegal character: \12288
????stmt.close();
^



...全文
22 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
色老虫 2003-12-17
  • 打赏
  • 举报
回复
????String url="jdbc:microsoft:sqlserver://localhost:8080;DatabaseName=pubs";

这些变量申明前边都干了什么呀?不会是把注释加到前边了吧?加注释也得// 后边写,晕
色老虫 2003-12-17
  • 打赏
  • 举报
回复
????stmt……………………

你干吗这样写,原来是 你好吗stmt 这样的吧,变量用英文吗,干吗前边加个中文
qdlg 2003-12-17
  • 打赏
  • 举报
回复
怎样解决啊??
upcmill 2003-12-15
  • 打赏
  • 举报
回复
中文问题,导致了sql错误
giftxi 2003-12-15
  • 打赏
  • 举报
回复
数据库连接错误了,看看中文问题有没有解决,最好是把JSP和数据处理分开写,把数据处理的部分写一个类,JSP里调用,这样比较容易调试。结构也比较好。

81,092

社区成员

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

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