This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This is my code for executing sql. I have a prob with one table/insert query where I send in 'INSERT into ....', nd nothing happens, no error , no exception, no data in table
If I copy sql out in debug time and execute it in some client software it works OK.
Can con be null? That would throw null pointer and wouldn't be caught by your SQLException.
Can prepareStatement(String sql) throw an exception that is not a SQLException? It seems to me you are likely throwing some exception out of that first line in the try block. If prepareStatement doesn't like your SQL statement, can it throw some Throwable like IllegalArgumentException?
You wanted ideas...
Joined: Nov 23, 2010
Yea, right. The connection was null. Thanks.
The code was old and untouched , so it should work.
Drilling down, figured that some foregin key is somehow corrupted, although looking good.
Deleted it and now it works.