• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Write to DB immediately before cnn.close()

 
Nair Anoop
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Nair Anoop
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I shall give it a try.
~ Anoop
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic