The “invalid character” exception is very common in a JDBC code due to a small mistake. I have seen many beginners asking this question and searching on google that
I am getting below exception, while running a JDBC query. I have checked my query its working fine when I run directly from a SQL client. What could be the reason?
java.sql.SQLException: ORA-00911: invalid character at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:676) at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:602) at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:571) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
I have observed this with the programmers who are comfortable with Oracle or some other database (e.g. MySQL, PostgresSQL) clients where semicolon is required at the end of query (like many PL/SQL command line clients).
Hope this post helps you resolve your problem quickly, feel free share your thoughts in comments if this helps or not.
Thanks!! it has been very usefull for me.
Thanks, a very usefull hint
Superb. Thank you. A very very useful hint.
It work!
very useful hint, thank you very much
Thank u so much.This help me lot
Thank u very much. u solve my problem
Thank u so much, this was very useful to me.
Thank you so much!BR,Rodolfohttp://dotdebug.blogspot.com/
THanx man, you saved my life!
Absolutely useful and right to the point ! Thanks alot…
Thanks a lot. It saved my time.
wonderful. Saved a lot of time.
Thanks really nice one.
Thnk u for this really thnks a lot.
Thanks!!!! u solve my problem!
Very useful hint..saved my lot of time..
Wasted a lot time , finally found this thanks a lot 🙂
Gud info ,thnx a lot.
Thank you. It helped!
thanks, it solve my problem
Thanks, it was very useful.
Thank you.
Thanks!
Thanks!
Thanks a lot…
thanks a lot
That solved my issue quickly, very helpful tip
thanks it helped me..
this was a life saver. Stupid JDBC! Thanks.
Thank you very much.
gr8
Many thanks.
Thanks a lot… You are absolutely correct.
thanks a lot
I can believe it… after three weeks to fight with this, you solved it!! THANK YOUUU
thnks a lot…
Thanks 🙂
Thanks a lot, its very helpful.
Thanks 🙂
Thank You…….
Thank you
ss
that's really a good hint,you solved my problem..:)
yes "invalid Character" went off after removing the ";", But now i am getting the error "Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist", Here is the query that i am using inside my iBatis mapping file
INSERT INTO ${schema}.DUMMY(TXN_ID, BTCH_NUM, TXN_TYPE_CD)
VALUES (#{transactionId}, #{batchNum}, #{tnx_type_cd})
please help me to resolve this error 🙁
thx,it is working
Thanks,Its wrkng..:)
Thank u so much.This help me lot
Thank you ..
This solved my problem .
Abdullah
Thank you !!!
Solved my problem