重大问题:用JSP代码创建ACCESS数据库/表格!!!!
package fundpack;
import java.sql.*;
public class CONTROLDB{
String url= "jdbc:odbc:fundconn ";
Connection conn=null;
Statement stmt=null;
public CONTROLDB() {
try{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver ");
conn=DriverManager.getConnection(url);
}catch(Exception e){
System.out.println(e.getMessage());
}
}
public ResultSet executeQuery(String sql){
ResultSet rs=null;
try{
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery(sql);
}catch(Exception e){e.printStackTrace();
System.out.println(e.getMessage());
}
return rs;
}
public void executeUpdate(String sql){
try{
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
stmt.executeUpdate(sql);
}catch(Exception e){
System.out.println(e.getMessage());
}
}
public void close() throws Exception{
if (stmt != null) {
stmt.close();
stmt = null;
}
if(conn != null){
conn.close();
conn = null;
}
}
}
这是我的数据库连接文件CONTROLDB.java,数据源为fundconn,我该如何在jbuilder里面用代码在access数据库里面创建新的表格阿?比如
<%@ page contentType= "text/html; charset=GB2312 " %>
<%@ page import= "fundpack.*,java.sql.* "%>
<%@ page import= "javax.servlet.* " %>
<HTML>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<meta name= "GENERATOR " content= "Microsoft FrontPage 4.0 ">
<meta name= "ProgId " content= "FrontPage.Editor.Document ">
<body>
<%
String sql= "cr