This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
Joined: Aug 10, 2004
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).
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.
Joined: Aug 10, 2004
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?
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.