通过jdbc-mySQL执行多条insert语句的问题
各位大虾,小弟在jdbc中执行如下的程序,老报错误,而且不知名的错误。请各位救命,感激不尽。
sql="insert into TEST values('100','test') ";
stmt=cnMySQL.createStatement();
stmt.addBatch(sql);
stmt.addBatch(sql);
stmt.executeBatch();
//stmt.executeUpdate(sql);
或者,把多条语句写到变量sql中,调用stmt.executeUpdate(sql);还是错误,难道jdbc-MySQL不支持多语句执行么?我用的是mm的jdbc