Unsupported SQL 1111 type when passing String to VARCHAR field

I'm about to swing my head.

I am using iBatis with my JAVA code to run a stored Proc located in Sybase DB.

The stored procedure expects some parameters. some of them are declared asVARCHAR (6)

So, in my iBatis mapping for these parameters, I did the following.

<parameter property="searchUserId" jdbcType="String" javaType="java.lang.String" mode="IN"/>

However, when I do this, I get the following error.

--- Check the statement (update procedure failed).  
--- Cause: java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 1111.
Caused by: java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 1111.

So, I changed my mapping to the following:

<parameter property="searchUserId" jdbcType="VARCHAR" javaType="java.lang.String" mode="IN"/>

which got rid of the above error, however now the parameter searchUserIdreceives the value nullpassed to SP. I know for sure that from my java code I DO NOT skip null.

Has anyone encountered this problem? What should I change my mapping?

+3
3

, VARCHAR jdbcType. , ?

- , , ( , , ). , , "userId" Ibatis).

0

: geometry (PostGIS extension), , , . .

+1

I also faced a similar situation. After a lot of searching, I finally found that the answer to my problem was that I didn’t have a specific β€œkey” when building the map. I missed the statement:

map.put("job_name", job.getJobName());

& I used JOB_NAME = # {job_name} in CronMapper.xml

Also some where else I used JOB_NAME = # {jobName}

0
source

Source: https://habr.com/ru/post/1726484/


All Articles