创建access数据库出现问题
下边这段代码:<% page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,*"%>
<html>
<body>
<center>
数据库的删除与创建<br><br>
<table width="200" border="0">
<tr>
<td><%
try
{
String sDBDriver ="sun.jdbc.odbc.JdbcOdbcDriver";
String sConnStr = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=dbaccess.mdb";
Connection Con= null;
Statement Stnt = null;
try
{
Class.forName(sDBDriver).newInstance();
}
catch(java.lang.ClassNotFoundException e)
{
out.print("Connect to Database error: " + e.getMESSAGE());
}
try
{
Con = DriverManager.getConnection(sConnStr,"sa","");
}
catch(SQLException e)
{
out.print(e.toString());
}
Stmt=Con.createStatement();
try
{
Stmt.execute("drop database tther;");
}
catch(SQLException e)
{
out.println(e.getMessage());
}
Stmt.execute("create database other;");
Stmt.execute("use other;create table one(t int,t2 varchar(16))");
Stmt.execute("use other;alter table one add t3 varchar(16) null");
Stmt.execute("use other;insert into one values(1,'fafa','hehe')");
out.println("数据库other创建成功");
Stmt.close();
Con.close();
}
catch(Exception e)
{
e.printStachTRACE();
}
%></td>
</tr>
</table>
<center>
</body>
</html>
显示如下错误:
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: 1 in the jsp file: /del_new_db.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\del_005fnew_005fdb_jsp.java:42: ';' expected
page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,*"
^
1 error
org.apache.(DefaultErrorHandler.java:84)
org.apache.(ErrorDispatcher.java:332)
org.apache.(Compiler.java:412)
org.apache.(Compiler.java:472)
org.apache.(Compiler.java:451)
org.apache.(Compiler.java:439)
org.apache.jasper.(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.0.28
请问是怎么回事?