I have a problem. PrepareStatement returns 0 in my code but the query returns the correct result in my sql editor?!
I�m working within a servlet. First I do make a database connection and share that connection through the servlet lifetime... Inside the doPost method I first call a synchronized method which do the following task:
synchronized method_1 () 1) SELECT MAX(id) 2) UPDATE date for the max(id) (I use type 2 historic) 3) INSERT request values 4) SELECT MAX(id) (from the insert) 5) return new MAX(id)
- That works fine. After that I call yet another synchronized method where I do the same task, just in another table:
I close my resultSet after every Query. I have tried to close my preparedStatement too (stat.close()). I have also tried to close my connection after doing the task in each synchronized method, and open a new connection. That doesn�t work either...
The code looks like the following:
[ January 29, 2005: Message edited by: Jeppe Fjord ] [ January 29, 2005: Message edited by: Jeppe Fjord ]
Jeppe, Are you sure the inserts are being committed to the database? Also, out of curiousity, why are you using a synchronized method rather than a transaction?
Jeppe, please do not re-post the same question more than once. Please continue any discussion in the original post. [ January 29, 2005: Message edited by: Bear Bibeault ]