Java Mailing List Archive

http://www.java2.5341.com/

Home » user-java.ibatis »

ibatis & derby problem

Zsolt Koppany

2008-11-19

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

with all newer derby versions I get an Exception if I want to store NULL
values.

Derby (or ibatis) wants my application telling also the java type of the
NULL value something like below:

#value:INTEGER#

We cannot modify all ibatis files and additional we should write a lot
of new tests testing all possible NULL values.

We use ibatis-2.3.4.726.

How can we fix the problem?

Zsolt

com.intland.codebeamer.persistence.util.PersistenceException:
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the createUser-InlineParameterMap.
--- Check the parameter mapping for the 'hostName' property.
--- Cause: java.sql.SQLException: An attempt was made to get a data
value of type '<UNKNOWN>' from a data value of type 'VARCHAR'.
 at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate (MappedStatement.java:107)
 at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert (SqlMapExecutorDelegate.java:393)
 at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert (SqlMapSessionImpl.java:82)
 at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert (SqlMapClientImpl.java:58)
 at
com.intland.codebeamer.persistence.util.SqlMapClientWrapper.insert(SqlMapClientWrapper.java:302)
 at
com.intland.codebeamer.persistence.dao.AbstractDao.create(AbstractDao.java:82)
 at
com.intland.codebeamer.persistence.dao.impl.UserDaoImpl.create(UserDaoImpl.java:90)
 at
com.intland.codebeamer.persistence.test.AbstractUserPersistenceTests.createAccount(AbstractUserPersistenceTests.java:42)
 at
com.intland.codebeamer.persistence.test.AbstractProjectPersistenceTests.setUpBeforeClass(AbstractProjectPersistenceTests.java:102)
 at
com.intland.codebeamer.test.AbstractCodeBeamerTests.onSetUp(AbstractCodeBeamerTests.java:132)
 at
com.intland.codebeamer.persistence.test.AbstractPersistenceTests.onSetUp(AbstractPersistenceTests.java:467)
 at
org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:103)
 at junit.framework.TestCase.runBare (TestCase.java:125)
 at
org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
 at junit.framework.TestResult$1.protect(TestResult.java:106)
 at junit.framework.TestResult.runProtected (TestResult.java:124)
 at junit.framework.TestResult.run (TestResult.java:109)
 at junit.framework.TestCase.run (TestCase.java:118)
 at junit.framework.TestSuite.runTest (TestSuite.java:208)
 at junit.framework.TestSuite.run (TestSuite.java:203)
 at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
 at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:460)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:673)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:386)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:196)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the createUser-InlineParameterMap.
--- Check the parameter mapping for the 'hostName' property.
--- Cause: java.sql.SQLException: An attempt was made to get a data
value of type '<UNKNOWN>' from a data value of type 'VARCHAR'.
 ... 26 more
Caused by: java.sql.SQLException: An attempt was made to get a data
value of type '<UNKNOWN>' from a data value of type 'VARCHAR'.
 at
org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown
Source)
 at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
 at org.apache.derby.client.am.PreparedStatement.setNull(Unknown Source)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke (Method.java:585)
 at
com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke (PreparedStatementLogProxy.java:70)
 at $Proxy1.setNull(Unknown Source)
 at
com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap.setParameter (ParameterMap.java:172)
 at
com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap.setParameters (ParameterMap.java:126)
 at
com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate (SqlExecutor.java:78)
 at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate (MappedStatement.java:216)
 at
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate (MappedStatement.java:94)
 ... 25 more
Caused by: org.apache.derby.client.am.SqlException: An attempt was made
to get a data value of type '<UNKNOWN>' from a data value of type 'VARCHAR'.
 at
org.apache.derby.client.am.PreparedStatement$PossibleTypes.throw22005Exception(Unknown
Source)
 ... 37 more


©2008 java2.5341.com - Jax Systems, LLC, U.S.A.