ORA-00911: Invalid character issue and resolution, ora-00911 characters
1. The original method for inserting data into a database table in java is as follows:
String SQL = "INSERT INTO AAA (id1, id2, id3, id4) VALUES ('1', '2', '3', '4 '); "export basedao.exe xuteBySql (SQL );
The basedao.exe xuteBySql method called in 2's is as follows:
Public int exexuteBySql (String SQL) throws Exception {try {log. debug ("SQL :{}", SQL); SQLQuery query = null; Session session = this. getHibernateTemplate (). getSessionFactory (). getCurrentSession (); query = session. createSQLQuery (SQL); return query.exe cuteUpdate ();} catch (RuntimeException re) {log. error ("exexuteBySql (String SQL)", re); throw re ;}}
3, my database is oracle11g, the results in the execution of the error ORA-00911: invalid characters
4. Remove the number at the end of the SQL statement.
String SQL = "INSERT INTO AAA (id1, id2, id3, id4) VALUES ('1', '2', '3', '4 ') "export basedao.exe xuteBySql (SQL );