Hi:
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
Hechun
log4j: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”