Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

forum regarding insert data

 
surya nara
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!