This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 3606
    
  60

Duplicate of http://www.coderanch.com/t/614654/JDBC/databases/Insert-exists. Please continue the discussion there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Insert into table where not exists
 
Similar Threads
Insert SQL syntax error
how can we use where clause with insert query using preparedStatement?
how to retrieve value from autogenerated(oracle sequence) column in a servlet.
SQL Exception:General Error
Problem Insert where not exists