1. The purpose of this post

Sometimes, when we copy and paste sql scripts from sqlplus or plsql to java programs, we get this exception or error like this:

ORA-00911: invalid character found in sql...

2. Solution

Check if your sql has semicolon at the end of your sql.

My old sql:

insert   into  tablea(aaa)   values('111');

My new sql:

insert   into  tablea(aaa)   values('111')

Run the sql , everything works fine now.