Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes not insering all the  records (please help!!) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "not insering all the  records (please help!!)" Watch "not insering all the  records (please help!!)" New topic
Author

not insering all the records (please help!!)

catherine matthews
Ranch Hand

Joined: Jan 22, 2006
Posts: 78
Hi all,

i am creating a tableA with a few records in one connection.
With another connection i am inserting all the records from tableB into tableA

In short i append the tableA with tableB using the execute statement below.

st2.executeUpdate("insert into FormulaQ1Q2 select * from FormulaQ1")

The prblem is not all the records are being inserted. After appen i should have 2000records. I am only having 1923 records. Please let me know what is the problem?
[ April 23, 2008: Message edited by: catherine matthews ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"Lost" records are very unlikely, and if there were an error the whole insert would fail. Are you sure 2000 is what you should get?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
catherine matthews
Ranch Hand

Joined: Jan 22, 2006
Posts: 78
I am using Jackess to copy the tables. As i copy The first tableA i have the correct amount of records. After i copy the second Table. The records in the first table gets changed. I loose 4 records. And the number of records in tableA becomes lesser. This is my method to copy the table.
I am using the same method. Changing the variable for the Connection.
Please let me know why this wierd thing is happening


[ April 24, 2008: Message edited by: catherine matthews ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: not insering all the records (please help!!)
 
Similar Threads
FOREIGN KEY
how to retrieve values from more than two tables
inserts into join tables
Hibernate one-to-on id mapping issue
Help in SQL Query