This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Unable to insert foreign key values.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Unable to insert foreign key values.." Watch "Unable to insert foreign key values.." New topic
Author

Unable to insert foreign key values..

Jyothirmayee Naidu
Greenhorn

Joined: Dec 19, 2007
Posts: 3
Hai All,

I have created two tables as below.collegeid column in department_details table references collegeid column of

college_details.



Coming to JSP portion.


Below I am sending you the Jspcode,I am trying to insert first table data from first form and second table data from second

form,in which i am retreiving collegeid of first form in second from and inserting into foreign key value.but im getting

ERROR.




Please help me guys.

Sincere Regards,
Jyothirmayee.
Suraj Berwal
Greenhorn

Joined: Dec 28, 2001
Posts: 26
Hello Jyothi,

It is not advisable to write your database login in JSP. They should be coded in Java classes and accessed using Java objects.

Now, are you able to populate your first table using FirstForm.jsp?
Also, what is the order in which your JSP is called?

Kind Regards,
Suraj
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Unable to insert foreign key values..
 
It's not a secret anymore!