这个JSP怎么运行不了啊? (初级问题)(100分)

  • 主题发起人 主题发起人 zhoen889
  • 开始时间 开始时间
Z

zhoen889

Unregistered / Unconfirmed
GUEST, unregistred user!
<%@ page contentType=&quot;text/html;charset=gb2312&quot;%>
<%@ page language=&quot;java&quot;%>
<%@ page import=&quot;java.sql.*,java.io.*,java.util.*&quot;%>
<html>
<head>
<title>操作数据库范例</title>
</head>
<body bgcolor=&quot;#FFFFFF&quot;>
<%
String driver=&quot;com.microsoft.jdbc.sqlserver.SQLServerDriver&quot;;
String url=&quot;jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs&quot;;
String user=&quot;sa&quot;;
String password=&quot;&quot;;
try{
Class.forName(driver).newInstance();
}catch(Exception E){
out.print(&quot;无法加载驱动程序&quot;+driver);
E.printStackTrace();
}
try{
Connection con=DriverManager.getConnection(url,user,password);
    Statement stmt=con.createStatement();
stmt.executeUpdate(&quot;delete from table_A&quot;);
stmt.close();
con.close();
}catch(SQLException SE){
SE.printStackTrace();
}
%>
</body>
</html>
提示错误:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 8 in the jsp file: /study/jdbctest.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:/Tomcat 4.1/work/Standalone/localhost/_/study/jdbctest_jsp.java:58: illegal character: /12288
??????Statement stmt=con.createStatement();
^
An error occurred at line: 8 in the jsp file: /study/jdbctest.jsp
Generated servlet error:
C:/Tomcat 4.1/work/Standalone/localhost/_/study/jdbctest_jsp.java:58: illegal character: /12288
??????Statement stmt=con.createStatement();
^
An error occurred at line: 8 in the jsp file: /study/jdbctest.jsp
Generated servlet error:
C:/Tomcat 4.1/work/Standalone/localhost/_/study/jdbctest_jsp.java:58: illegal character: /12288
??????Statement stmt=con.createStatement();
系统环境:
操作系统:Windows Xp Pro
J2SDK版本:j2sdk-1_4_2_04-windows
Tomcat版本:jakarta-tomcat-4.1.30
本地数据库:SQL Server 2000
 
后退
顶部