wood burning stoves
The moose likes JDBC and Relational Databases and the fly likes Problem of inserting java array into DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Problem of inserting java array into DB " Watch "Problem of inserting java array into DB " New topic

Problem of inserting java array into DB

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 833

I am facing problem with the following piece of code that everytime it inserts in db (#ofRecords * 3)

I printed on tomcat console and output is:


I mean it showing correct results as I inserted two records whilst in database I see 6 records after this code. This code always insert (number of records * 3). Why?

Here how I calling this method

Here what am seeing through SQL:

The problem fixed as there was nothing wrong with the code but in database 3 records for each CVs were exists that was inserted with wrong code.

Sorry for inconvenience

Best regards
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3719

I'd suggest to add a primary key or unique constraints to prevent creating duplicates in the first place. This should expose the culprit (the code that tries to create the duplicates).
I agree. Here's the link: http://aspose.com/file-tools
subject: Problem of inserting java array into DB
It's not a secret anymore!