• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in insertion of data

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I m facing problem when i insert data into the MS Access through JDBC. I m using jdk1.4 Beta and have got the results using next method. Even though i m passing the parameters ResultSet.TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE in createStatement method.
Can anyone tell me about what i m missing.
Thanks in Advance
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are connecting to an Access database you are probably using the JDBC-ODBC bridge (type 1 driver) so all those settings are ignored. Or rather, they are not supported by that driver.
There is a problem where inserts and updates don't go through until the next operation is performed on the connection.
Try one of these:
* if you need to, insert another row.
* or you can perform a dummy select like select id from table
* I usually set autoCommit(true) and have no problems. I don't usually recommend doing this, but if it's Access, who cares!
Dave
 
Malik Tahir
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks David for your valueable tip.
 
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also have some problems with Access.
I will try the setAutocommit(true), but I think that it is the default behaviour. So, I'm not sure that it will change anything.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a problem with the updates of existing records that can be solved using a dummy query (query something small and don't to do anything with the results). But from my experience and a couple other posts I've found (with massive searching) there is also a bug in the odbc driver for Access that comes with Windows 2000 service pack 2 (not sure if it's in the earlier sp's or not). I solved my problem by installing sp3. I believe you can also download the mdac package from microsoft at
http://www.microsoft.com/data/download.htm
and get the driver from it. I don't know if this will interfere with anything else though.
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic