try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException ex) {
}
try {
Connection con = java.sql.DriverManager.getConnection(
"jdbc:odbc:job");
Statement s = con.createStatement();
/*本插入语句中 this.jTextField6.getText() 大家发现它插入的时候不是'"++"'的
形式,它是"++"这个字段在表中的的数据类型是money类型的,那么我想问下还有什么数据
类型在java连SQL200的时候是特殊的?书写格式是怎样的?还有为什么那样书写?*/
s.executeUpdate("insert into yg(name,age,sex,stu,job,gozi) " +
" values('" +
this.jTextField1.getText() + "','" +
this.jTextField2.getText() + "','" +
this.jTextField3.getText() + "','" +
this.jTextField4.getText() + "','" +
this.jTextField5.getText() + "'," +
this.jTextField6.getText() + ")");
} catch (SQLException ex1) {
}
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException ex) {
}
try {
Connection con = java.sql.DriverManager.getConnection(
"jdbc:odbc:job");
Statement s = con.createStatement();
/*本插入语句中 this.jTextField6.getText() 大家发现它插入的时候不是'"++"'的
形式,它是"++"这个字段在表中的的数据类型是money类型的,那么我想问下还有什么数据
类型在java连SQL200的时候是特殊的?书写格式是怎样的?还有为什么那样书写?*/
s.executeUpdate("insert into yg(name,age,sex,stu,job,gozi) " +
" values('" +
this.jTextField1.getText() + "','" +
this.jTextField2.getText() + "','" +
this.jTextField3.getText() + "','" +
this.jTextField4.getText() + "','" +
this.jTextField5.getText() + "'," +
this.jTextField6.getText() + ")");
} catch (SQLException ex1) {
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货