Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

values not been inserted

 
Mateen Dar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




this code dodent produce any errors , but also no values are been inserted into the database . i tried it with a select * quesry and the rows are been selected. only there are not been inserted . whats wrong.








[added code tags]
[ September 07, 2005: Message edited by: Jeanne Boyarsky ]
 
Horatio Westock
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

Could you post the actual code you have compiled and tested? The code you have here has syntax errors.

If you use the CODE button at the bottom and paste your code between the tags, all of the indentation will be kept - which helps in debugging.

Ta.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rule number 1: stop using Access and the jdbc-odbc bridge. It sounds harsh, but you wouldn't have this problem otherwise.

The temporary solution: do a dummy select after the insert (ie select anything), commit the connection or set the connection to autocommit(true)

Or stop using the jdbc-odbc bridge.
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd also recommend using PreparedStatements if you can instead of Statements.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dave Salter:
I'd also recommend using PreparedStatements if you can instead of Statements.


Always true (at least in my view), although the pointers I gave will work around a known JDBC-ODBC issue where statements get cached in the Driver and require an extra operation to flush them.
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you suggest which driver should be used when using MS-Access.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recommend the Oracle and MySQL Drivers. They won't work with Access, but they will work with Oracle and MySQL. You can search for other Access drivers here.
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats a good resource. Thanks for that David.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic