Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Last record is not inserted

 
ganapathy gopinathan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi wagner,

Thank u 4 ur response.

In my code i m not using the loop.i just tried to insert only one record. while i was doing so, i got no errors. and the record was not inserted. but when i tried with the 2 records using separate 'insert' command it was working.

 
ganapathy gopinathan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i inserted 2 records, i could not insert the last one(second one).
when i inserted 3 records, i could not insert the last one( third one).
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you paste loop part of your code
 
PJ Crump
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you do a commit after the inserts? If not, you need to.
 
ganapathy gopinathan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi crump,

Thank u for ur response. but i tried with that it is not working.

when i just tried to do insert, this happens.

when i tried to insert and read the records from the same table it is working. i dont know y???

regards
gopi
[ September 29, 2004: Message edited by: ganapathy gopinathan ]
 
ganapathy gopinathan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandra,

Here is my code,




This is working fine in my friend's system, but i m getting this problem while i m working in my system.

Thank u
gopinathan
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try executeUpdate()
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Translation:
u = you
ur = you are, you're
4 = for
y = why
i m = I'm
Please don't be lazy. Contractions make posts harder to read. Are large proportion of JavaRanch users don't have English as their first language, so combining contractions with spelling and grammar errors just serves to make communication harder when we should be trying to make it easier. Thanks.

Please give us more information. If you are using MS Access and the JDBC-ODBC bridge, this is a common problem, you'll find several hundred threads discussing it in this forum. The simple solution is either set autoCommit to true or do a 'dummy read' to flush the connection.
 
ganapathy gopinathan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the inconvenience, near after i will follow your request.

yes, i am using JDBC-ODBC driver with MS-ACCESS.

Is the problem in the MS-ACCESS or in JDBC-ODBC?
where i have to use the 'autocommit'?
Is it in MS-ACCESS or in my coding?


Thank you,
gopinathan
[ September 30, 2004: Message edited by: ganapathy gopinathan ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem.

I believe the issue is caused by the JDBC-ODBC driver. It was only designed as a quick fix to bridge the gap between the two technologies and has outgrown its purpose. It was never meant for production systems and has greater issues than this one!

It appears the driver caches queries and needs 'one more request' to make sure the previous one gets flushed, hence the 'dummy select' at the end. Presonally I always set the auto commit, but then I try not to use Access anyway.

I hope your problem is fixed.
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic