wood burning stoves
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Entity not saving-Need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Entity not saving-Need help" Watch "Entity not saving-Need help" New topic

Entity not saving-Need help

Sharmila Punde
Ranch Hand

Joined: Dec 26, 2007
Posts: 133
Dear All,
Please take look at following Entity which compiles fine. Users table exists into schema 'app'.
I am using glassfish 3.0.1, Eclipse Persistence Services - 2.0.1 as provider, javadb

The code in servlet which is compiled -

The code in tracker bean as-

When servlet code is executed i get following error
Internal Exception: java.sql.SQLSyntaxErrorException: 'USER_ID' is not a column in table or VTI 'APP.USERS'.
Error Code: -1
Call: INSERT INTO app.users (user_id, username, category, password) VALUES (?, ?, ?, ?)
bind => [1, somename, 4, passsomeone]
Query: InsertObjectQuery(examples.entities.User[id=1, somename, passsomeone, 4])

What is problem, why i am getting this exception?


Regards, Sharmila.
We will have a future if we save Nature!
Sharmila Punde
Ranch Hand

Joined: Dec 26, 2007
Posts: 133
Dear All,
It is solved, i can save that entity. There were two databases in my machine. One was installed
for NetBeans IDE 6.9.1, another was installed by me in /root/. I changed the port and now connected
to right database.
I agree. Here's the link: http://aspose.com/file-tools
subject: Entity not saving-Need help
It's not a secret anymore!