Z
zhoen889
Unregistered / Unconfirmed
GUEST, unregistred user!
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page language="java"%>
<%@ page import="java.sql.*,java.io.*,java.util.*"%>
<html>
<head>
<title>操作数据库范例</title>
</head>
<body bgcolor="#FFFFFF">
<%
String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs";
String user="sa";
String password="";
try{
Class.forName(driver).newInstance();
}catch(Exception E){
out.print("无法加载驱动程序"+driver);
E.printStackTrace();
}
try{
Connection con=DriverManager.getConnection(url,user,password);
Statement stmt=con.createStatement();
stmt.executeUpdate("delete from table_A"
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
<%@ page language="java"%>
<%@ page import="java.sql.*,java.io.*,java.util.*"%>
<html>
<head>
<title>操作数据库范例</title>
</head>
<body bgcolor="#FFFFFF">
<%
String driver="com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs";
String user="sa";
String password="";
try{
Class.forName(driver).newInstance();
}catch(Exception E){
out.print("无法加载驱动程序"+driver);
E.printStackTrace();
}
try{
Connection con=DriverManager.getConnection(url,user,password);
Statement stmt=con.createStatement();
stmt.executeUpdate("delete from table_A"
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