更新时间:2022-06-22 02:41:51
在此PreparedStatement对象中执行SQL语句,该对象必须是SQL INSERT
,UPDATE
或DELETE
语句;或不返回任何内容的SQL语句,例如DDL语句.
Executes the SQL statement in this PreparedStatement object, which must be an SQL INSERT
, UPDATE
or DELETE
statement; or an SQL statement that returns nothing, such as a DDL statement.
当前,您正在尝试使用它来创建表.这就是为什么您会收到该错误的原因.
Currently you are trying to use this for creating a table. That's the reason why you are getting that error.
请参阅文档 Java 1.4.2 用于 executeUpdate
您应该使用Statement
Statement st = con.createStatement();
String table = "Create table .......";
st.executeUpdate(table);