hi,
when I try to insert data into database, the
log4j log display the following error messages:
Code:
WARN [org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:77)] (13-04-2008 02:26:50) - SQL Error: 0, SQLState: S1000
ERROR [org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:78)] (13-04-2008 02:26:50) - java.lang.ArrayIndexOutOfBoundsException: 6
ERROR [com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:80)] (13-04-2008 02:26:50) - #{LoginAction.doLogin}: javax.faces.el.EvaluationException: org.hibernate.exception.GenericJDBCException: could not insert: [SkyTin.Login.User]
javax.faces.FacesException: #{LoginAction.doLogin}: javax.faces.el.EvaluationException: org.hibernate.exception.GenericJDBCException: could not insert: [SkyTin.Login.User]
...
/* Some error messages .. */
...
Caused by: javax.faces.el.EvaluationException: org.hibernate.exception.GenericJDBCException: could not insert:
...
/* Some error messages .. */
and the
catatina.out display the insert command, when i copy it to mysql command prompt and substitute suitable values, it can insert data into database:
Code:
Hibernate:
insert
into
LOGIN
(LOGIN_ID, USER_ID, LOGIN_DATE, IP_ADDR, IS_SUCCESS)
values
(null, ?, ?, ?, ?)
LoginLog.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Test.Login.LoginLog" table="LOGIN">
<id name="LOGIN_ID" column="LOGIN_ID">
<generator class="native"/>
</id>
<property name="USER_ID" column="USER_ID"/>
<property name="LOGIN_DATE" column="LOGIN_DATE"/>
<property name="IP_ADDR" column="IP_ADDR"/>
<property name="IS_SUCCESS" column="IS_SUCCESS"/>
</class>
</hibernate-mapping>
P.S. it can select data from database, but cannot use save() and saveOrUpdate()
How can I solve it ?
Thanks