连接sql 2000数据库出错!!!!!!!

Sherlock_Holmes Sherlock_Holmes 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 5 in the jsp file: /conn.jsp
Generated servlet error:
I:\Tomcat5.0\work\Catalina\localhost\myweb\org\apache\jsp\conn_jsp.java:49: illegal character: \12288


An error occurred at line: 5 in the jsp file: /conn.jsp
Generated servlet error:
銆?銆?String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=word";
^


An error occurred at line: 5 in the jsp file: /conn.jsp
Generated servlet error:
I:\Tomcat5.0\work\Catalina\localhost\myweb\org\apache\jsp\conn_jsp.java:49: illegal character: \12288


An error occurred at line: 5 in the jsp file: /conn.jsp
Generated servlet error:
銆?銆?String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=word";

源码-------------------------------------------------------------
<%@ page language="java" contentType="text/html;charset=gb2312"%>
  <%@ page import="Java.sql.*"%>
  <html>
  <body>
  <% Class.forName("com.microsoft.JDBC.sqlserver.SQLServerDriver").newInstance();
  String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=word";
  //word我的数据库的
  String user="sa";
  String password="";
  
  Connection conn= DriverManager.getConnection(url,user,password);
  Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
  String sql="select * from t_counter"; //t_counter 表
  ResultSet rs=stmt.executeQuery(sql);
  while(rs.next()) {%>
  您的第一个字段内容为:<%=rs.getString(1)%>
  您的第二个字段内容为:<%=rs.getString(2)%>
  <%}%>
  <%out.print("数据库操作成功,恭喜你");%>
  <%rs.close();
  stmt.close();
  conn.close();
  %>
  </body>
  </html>

是什么问题啊,能帮我解决一下吗???
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
Sherlock_Holmes
Web 开发 81,108 成员 341,721 内容