This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem: SQL Exception

 
Simon John
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sql Exception is thrown : java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] You cannot add or change a record because a related record is required in table 'BATCH'.

BATCH TABLE
------------
BATCHID TEXT (PRIMARY KEY)
STUDENT TABLE
-------------
FIRSTNAME TEXT
LASTNAME TEXT
YEARID TEXT
SECTION TEXT
ROLLNO TEXT (PRIMARY KEY)
BATCHID TEXT (PRIMARY KEY)
DEPTCODE TEXT (PRIMARY KEY)
ADDRESS TEXT
PHONENO TEXT
MOBILENO TEXT
EMAIL TEXT
GENDER TEXT
PASSWORD TEXT
ENROLLMENTNO TEXT
"INSERT INTO STUDENT ( FIRSTNAME , LASTNAME , YEARID , SECTION , ROLLNO , BATCHID , DEPTCODE , ADDRESS , PHONENO ,MOBILENO , EMAIL , GENDER , PASSWORD , ENROLLMENTNO ) VALUES ('"+firstName+"', '"+lastName+"', '"+yearID+"', '"+section+"', '"+rollNo+"', '"+batchID+"', '"+deptCode+"', '"+ address+"', '"+phoneNo+"', '"+mobileNo+"', '"+emailAddress+"', '"+gender+"', '"+password+"', '"+enrollmentNo+"')";
The value of the batch ID that i m passing in the above query in already present in the Batch Table
 
Simon John
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have solved the problem
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic