import java.sql.*;
import javax.sql.*;
public class shujuku
{
public static void main(String args[])
{
String driv="sun.jdbc.odbc.JdbcOdbcDriver";
String ur="jdbc:odbc:myDataSource";
Connection con=null;
String name="sa";
String pass="";
Statement st=null;
String create="CREATE TABLE student0("+"id int not null unique,"
+"name int );";
try
{
Class.forName(driv);
con=DriverManager.getConnection(ur,name,pass);
st=con.createStatement();
boolean b=st.execute(create);
System.out.println(b);
}
catch(Exception e){e.printStackTrace();}
}
}
随便写了一个,帮我测试一下,是不是我的数据库有问题?