File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Databases » JDBC
Reply locked New topic

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
Thank you for help
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3437

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