Just for future reference, to get this to work the proper javaType definition is "[B". This will allow the ClassLoader to instanciate a Class of type byte[].



Chris Mathrusse
[EMAIL PROTECTED]
Sybase, Inc
One Sybase Drive
Dublin, CA 94568
(925) 236-5553



[EMAIL PROTECTED]

09/14/2007 02:32 PM

Please respond to
[email protected]

To
"ibatis user" <[email protected]>
cc
Subject
TypeHandlerCallBack javaType for byte[]






I'm writing a TypeHandlerCallback for my application, which is running against Sybase ASE. I'm trying to convert a Block (IMAGE or TEXT) field into a byte[]. If I allow iBatis to handle this with the default TypeConverter the Sybase JDBC driver raises an exception complaining that getBlob() cannot be called.


The TypeHandler is rather simple as it simply reads the data as a BinaryStream. The problem that I'm having is registering it with iBatis in the sql-map-config file. While I know the JDBC type I can't seem to figure out how to tell iBatis that the Java type is a byte[].  If I specify byte[] iBatis raises an exception.


java.lang.ClassNotFoundException
: byte[]


So how do I register this Type Handler?


<
typeHandler javaType="?" jdbcType="LONGVARCHAR"

Thanks...

Reply via email to