584551877
高手帮下 我在连ACCR接数据
void Insert2(){
String a=new String(text1.getText());
String b=new String(text2.getText());
String c=new String(text3.getText());
String d=new String(text4.getText());
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}
catch(ClassNotFoundException e){
System.out.println(e.getMessage());}
try{
Connection con=DriverManager.getConnection("jdbc:odbc:student","","");
Statement stmt=con.createStatement();
String sqlstr="insert into score"+"valuse("+a+","+b+","+c+","+d+")";
stmt.executeUpdate(sqlstr);
con.close();
stmt.close();}
catch(SQLException ce){
System.out.println(ce.getMessage());
}
}