File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes Could not insert Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Could not insert" Watch "Could not insert" New topic

Could not insert

kwyap me

Joined: Apr 02, 2005
Posts: 8

This is my first time trying out hibernate. I am attempting to insert a new record via a servlet call in IE. This servlet would in turn invoke a javabean that does the actual work of insertion.

I believe there is something wrong with my deployment. Pls help to check

App Server: Tomcat 4
Database: SQL Server 2000
Hibernate ver: 2
Error Msg: could not insert: [spectra.commons.hibernate.AppLabs#2]

File Breakdown
---------------- This is the persistent POJO
hibernate.cfg.xml: This is located in my tomcat web-inf/classes
Additional remarks: All other library files are located in web-inf/classes

Database Script

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

If Hibernate has got as far as trying to make this insert then there is probably nothing wrong with your deployment.

Error Msg: could not insert: [spectra.commons.hibernate.AppLabs#2]

What else does the error message tell you? There should be some more information from SQL Server as to why it could not insert this record.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276


What does this file look like?

Also check your web server console to see if you get a stack trace of an exception, that might give you more information like something like "inserted value for field to long", It should be an SQLException in cases like that.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Could not insert
jQuery in Action, 3rd edition