java.sql.SQLException: ORA-00911: invalid character 编辑

java.sql.SQLException: ORA-00911: invalid character

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:112)
at oracle.jdbc.driver.T4CStatement.execute_for_rows(T4CStatement.java:474)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1028)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1125)
at com.dong.frame.data.InsertData.insertDate(InsertData.java:58)
at com.dong.frame.data.InsertData.main(InsertData.java:144)

。。。。

总结:

String sql="insert into dong_user(user_id) values('1');";

在程序里执行sql的时候,sql字符串中不要带;这个符号,程序员都习惯了在每句结尾加这个,所以出错

你可能感兴趣的:(SQLException)