aspose file tools*
The moose likes JDBC and the fly likes Insert into table where not exists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic
Author

Insert into table where not exists

wafa khan
Ranch Hand

Joined: Apr 29, 2013
Posts: 42
Hi all of you
I have code to insert into table sql so it works but when i execute many times it will be inserted the same data then i have repetition
So i want do an query for Insert into table where not exists
i use it in many queries it works but here i have the insert from arraylist<>
i work with java

this is the code :






VLAN= it's the first column in table but not primary key
and table has 5 columns
VLAN,desc,jr,vrf,address
Thank you for help
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Duplicate of http://www.coderanch.com/t/614654/JDBC/databases/Insert-exists. Please continue the discussion there.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Insert into table where not exists