Forums Register Login

Write to DB immediately before cnn.close()

+Pie Number of slices to send: Send
Hi,
I am using the jdbcodbc bridge with an Access DB. My main connection class is a static class, which is used by all other classes for db interaction. It all works fine, but when I perform a DB INSERT/UPDATE, the results do NOT get written to the DB until I explicitly call conn.close() In my case, this may not happen for a long time, until the program exits, but till then the other classes are not aware of the newly inserted data.
Any ideas would be highly appreciated.
Thanks in advance,
Anoop
+Pie Number of slices to send: Send
I have seen funny problems with the jdbc:odbc and access before. If you want the insert to take effect right away, sometimes you have to do an extra select to the table AFTER the insert. It seems to give a whack in the processor to commit the insert. IF you have autoCommit set to false you will have to call con.commit() to commit the changes.
Jamie
[Editted by Dave to fix the jdbc-odbc thing]
[This message has been edited by David O'Meara (edited November 18, 2001).]
+Pie Number of slices to send: Send
Thanks, I shall give it a try.
~ Anoop
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 738 times.
Similar Threads
Running Of Client / Server code on different VM.s
UML, Java & OO
package problem
should adapter implement Db interface
Unknown entity: java.util.ArrayList ???
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:32:23.