This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

values not been inserted

 
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 ]
 
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.
 
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.
 
Ranch Hand
Posts: 293
Mac OS X Netbeans IDE Java
  • 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.
 
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
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats a good resource. Thanks for that David.
 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!