We help IT Professionals succeed at work.
Get Started

Insert Record

mayaldi asked
Last Modified: 2008-02-01
I have a form that was developed using JAVA, and i am updating the DB2 server using type 4 drivers, i have a scenario where i need to check the DB to see if the record exists before inserting, is there a way to do this in one transaction rather than two ( that is first checking to see if it exists, and then inserting ). I know one option would be to set the unique key in the database to prevent multiple records, but unfortunately i cannot do this as there are other forms that allow duplicates to the same table. Any help is appreciated, i am tyring to optimize my code as much as possible....
Watch Question
Data Warehouse / Database Architect
This problem has been solved!
Unlock 1 Answer and 15 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE