I am using Mybatis framework for database persistence, connecting to Sybase database via Jconn4.jar and deploying my app on JBOSS 7 application server.
1) Mybatis mapper - CustomerMapper.xml
<update id="updateCustomerMapping" parameterType="java.util.Map" statementType="CALLABLE">
{call sp_update_customer( #{account_customer,jdbcType=CHAR,mode=IN},
#{customer_code,jdbcType=CHAR,mode=IN} )}
</update>
2) Sybase Procedure
CREATE PROCEDURE dbo.sp_update_customer
(
@account_customer varchar(10),
@customer_code varchar(12)=NULL
)
3) JBoss 7 standalone configuration
<datasource jta="true" jndi-name="java:/SybaseDS" pool-name="SybaseDS" enabled="true" use-ccm="true">
<connection-url>jdbc:sybase:Tds:****:1000/****?chained=false</connection-url>
<driver-class>com.sybase.jdbc4.jdbc.SybDriver</driver-class>
<driver>sybase</driver>
<security>
<user-name>****</user-name>
<password>****</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseValidConnectionChecker"/>
<background-validation>true</background-validation>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseExceptionSorter"/>
</validation>
</datasource>
Adding/Updating/Deleting single record works with Jconn4.jar but adding/updating/deleting multiple records does not work.
I suspect the issue is with jdbcType=CHAR in mybatis mapper xml is not compatible with jconn4.jar.I also tried jdbcType=VARCHAR but still could not resolve this issue.
The same mapper configuration(jdbcType=CHAR) works with older version of Sybase driver - jconn3.jar.
Please help to resolve this error.
I encounter the same issue using jconn4-7.jar. But if I use jconn4.jar it works. So you can try to use this one.