- This topic has 2 replies, 2 voices, and was last updated 20 years ago by Hechun Chen.
-
AuthorPosts
-
Hechun ChenMemberHi:
When I am following the “MyEclipse Hibernate Quickstart”. I could not save the data to database, but get exception as following. How could I fix the problem ?
Regards
Hechunlog4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate ExceptionCould not save objectjava.lang.RuntimeException: net.sf.hibernate.JDBCException: Could not save object
at com.yourcompany.HibernateTest.main(HibernateTest.java:37)
Caused by: net.sf.hibernate.JDBCException: Could not save object
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:776)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:731)
at com.yourcompany.HibernateTest.main(HibernateTest.java:31)
Caused by: java.sql.SQLException: Fail to convert to internal representation
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:226)
at oracle.jdbc.driver.CharCommonAccessor.getLong(CharCommonAccessor.java:238)
at oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:521)
at net.sf.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:69)
at net.sf.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:42)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:758)
… 2 more
Exception in thread “main”
Riyad KallaMemberHechun,
This is really a question for the Hibernate forums, not MyEclipse… I’m not saying this because I don’t want to help, but becuase I don’t know and it really is an issue dealing with hibernate functionality and the oracle driver. I’m sure people that have run into this can help you more effective there.
Hechun ChenMemberOK, Thanks.
-
AuthorPosts