This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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 ]