[ http://issues.apache.org/jira/browse/IBATIS-86?page=comments#action_60400 ] Clinton Begin commented on IBATIS-86: -------------------------------------
We need more information. Could you provide the relevant SQL map file? Also, be sure the specify the JDBC type for nullable collumns. For example: #myCol,jdbcType=VARCHAR# > Error after switching to postgres 8.0 while inserting to db > ----------------------------------------------------------- > > Key: IBATIS-86 > URL: http://issues.apache.org/jira/browse/IBATIS-86 > Project: iBatis for Java > Type: Bug > Components: SQL Maps > Environment: Windows xp, eclipse, java 1.4, dell inspiron 8200, postgres 8.0 > Reporter: knprince > > After switching the database to postgres 8.0(appropriate jdbc driver has been > placed), we are getting error while inserting to database, it looks like > becuase of confused data type by ibatis. for ex: for date column, and column > that is nullable etc. Following is the log while trying to insert in to a > table that has a varchar nullable and its value is null > com.ibatis.dao.client.DaoException: Failed to insert - id > [insertExportQuery], parameterObject [EMAIL PROTECTED] Cause: > com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred > in com/htcinc/dms/db/sqlmapdao/sql/Export.xml. --- The error occurred while > applying a parameter map. --- Check the insertExportQuery-InlineParameterMap. > --- Check the statement (update failed). --- Cause: java.sql.SQLException: > ERROR: column "loaded_from_date" is of type date but expression is of type > text Caused by: java.sql.SQLException: ERROR: column "loaded_from_date" is of > type date but expression is of type text Caused by: > com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred > in com/htcinc/dms/db/sqlmapdao/sql/Export.xml. --- The error occurred while > applying a parameter map. --- Check the insertExportQuery-InlineParameterMap. > --- Check the statement (update failed). --- Cause: java.sql.SQLException: > ERROR: column "loaded_from_date" is of type date but expression is of type > text Caused by: java.sql.SQLException: ERROR: column "loaded_from_date" is of > type date but expression is of type text at > com.ibatis.dao.client.template.SqlMapDaoTemplate.insert(SqlMapDaoTemplate.java:90) > at > com.htcinc.dms.db.sqlmapdao.ExportSqlMapDao.insertExportDocsQuery(ExportSqlMapDao.java:64) > 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:324) at > com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:61) at > $Proxy4.insertExportDocsQuery(Unknown Source) at > com.htcinc.dms.service.ExportDocsService.insertExportDocsQuery(ExportDocsService.java:65) > at -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
