{{theTime}}

Search This Blog

Total Pageviews

java.sql.SQLException: The INSERT statement conflicted with the FOREIGN KEY constraint "XXXXXFK1"

java.sql.SQLException: The INSERT statement conflicted with the FOREIGN KEY constraint "XXXXXFK1"
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:784)

Resolution:   

Check the foreign key constraint and first insert the required record.  If all records are inserted as part of current database transaction, make sure the sequence of inserts are handled correctly and also verify transaction commit levels.

No comments:

You are currently using plaintext http to connect.

Npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation must use TLS 1.2 or higher. S...