ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "March, Andres" <ama...@soe.sony.com>
Subject Postgres insert not working for varbit data type
Date Wed, 04 Jan 2006 22:22:10 GMT
A Postgres insert not working for varbit data type.  It attempts to bind
the parameters wrong even though I have spcified the jdbcType.

I have used every typeHandler I can find and still the same result.
Currently, my config is as follows:

 

<sqlMap namespace="MachineState">

 

            <parameterMap id="X86SegReg"
class="com.soe.freerealms.xml.model.X86SegReg">

                        <parameter property="ds" jdbcType="bit varying"

 
typeHandler="org.springframework.orm.ibatis.support.BlobByteArrayTypeHan
dler" />

                        <parameter property="es" jdbcType="bit varying"

 
typeHandler="org.springframework.orm.ibatis.support.BlobByteArrayTypeHan
dler" />

                        <parameter property="fs" jdbcType="bit varying"

 
typeHandler="org.springframework.orm.ibatis.support.BlobByteArrayTypeHan
dler" />

                        <parameter property="gs" jdbcType="bit varying"

 
typeHandler="org.springframework.orm.ibatis.support.BlobByteArrayTypeHan
dler" />

            </parameterMap>

            <insert id="insertX86SegReg"

                        parameterMap="X86SegReg">

                        <![CDATA[

                                    insert into x86_seg_reg (

                                                ds, 

                                                es, 

                                                fs, 

                                                gs)

                                    values (

                                                ?, 

                                                ?,

                                                ?, 

                                                ?)

                        ]]>

            </insert>

 

 

</sqlMap>

 

And the log:

 

23875 [http-8088-Processor25] DEBUG java.sql.PreparedStatement  -
{pstm-100001} PreparedStatement:        insert into x86_seg_reg (
ds,      es,      fs,      gs)    values (     ?,      ?,     ?,      ?)


23875 [http-8088-Processor25] DEBUG java.sql.PreparedStatement  -
{pstm-100001} PreparedStatement:        insert into x86_seg_reg (
ds,      es,      fs,      gs)    values (     ?,      ?,     ?,      ?)


23875 [http-8088-Processor25] DEBUG java.sql.PreparedStatement  -
{pstm-100001} Parameters: [[B@1af1915, [B@97b7b1, [B@9cd006, [B@11d75b9]

23875 [http-8088-Processor25] DEBUG java.sql.PreparedStatement  -
{pstm-100001} Parameters: [[B@1af1915, [B@97b7b1, [B@9cd006, [B@11d75b9]

23891 [http-8088-Processor25] DEBUG java.sql.PreparedStatement  -
{pstm-100001} Types: [[B, [B, [B, [B]

23891 [http-8088-Processor25] DEBUG java.sql.PreparedStatement  -
{pstm-100001} Types: [[B, [B, [B, [B]

 

and the error:

 

--- The error occurred in
com/soe/freerealms/domain/ibatis/MachineState.xml.  

--- The error occurred while applying a parameter map.  

--- Check the MachineState.X86SegReg.  

--- Check the statement (update failed).  

--- Cause: org.postgresql.util.PSQLException: ERROR: column "ds" is of
type bit varying but expression is of type bytea]; SQL was [] for task
[SqlMapClient operation]

 

24250 [http-8088-Processor25] ERROR
com.sony.soe.platform.webwork.ExceptionWrapperInterceptor  -
org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation;
bad SQL grammar []; nested exception is
com.ibatis.common.jdbc.exception.NestedSQLException:   

--- The error occurred in
com/soe/freerealms/domain/ibatis/MachineState.xml.  

--- The error occurred while applying a parameter map.  

--- Check the MachineState.X86SegReg.  

--- Check the statement (update failed).  

--- Cause: org.postgresql.util.PSQLException: ERROR: column "ds" is of
type bit varying but expression is of type bytea

 

 

 

-----------------------------------------

Andres March

Platform - Apps Engineering

Sony Online Entertainment

desk: 858.577.3373

cell:   619.519.1519

 


Mime
View raw message