aspose file tools*
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
Author

Could not insert

kwyap me
Greenhorn

Joined: Apr 02, 2005
Posts: 8
Hi

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




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


File Breakdown
----------------
AppLabs.java: 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
Bartender

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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

"spectra/commons/hibernate/applabs.hbm.xml"

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.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Could not insert