File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
JDBC and Relational Databases
forum regarding insert data
Joined: Sep 14, 2007
Sep 14, 2007 05:37:00
: [Microsoft][SQLServer 2000 Driver for
][SQLServer]The INSERT statement conflicted with the FOREIGN KEY constraint "FK_EmpDetails_Emp". The conflict occurred in database "itracker", table "dbo.Emp", column 'EmpId'.
how can i handle this exception
Joined: Apr 14, 2004
Sep 14, 2007 05:54:00
Make sure the data you insert doesn't conflict with your database constraints. My guess is you are inserting a record into the emp table that uses an empId that does not exist in empdetails?
I agree. Here's the link:
subject: forum regarding insert data
JDBC / SqlServer / MSDriver / executeBatch / no exception thrown
Insert Query with auto-incrementing key
Exception while trying to add a new user to the database
ResultSet is not updateable.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015