ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject TypeHandlerCallBack javaType for byte[]
Date Fri, 14 Sep 2007 21:32:25 GMT

<br><font size=2 face="sans-serif">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. </font>
<br><font size=2 face="sans-serif">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[]. &nbsp;If I specify byte[] iBatis raises an exception.</font>
<br><font size=2 color=#000080 face="Courier New"><u>java.lang.ClassNotFoundException</u></font><font
size=2 face="Courier New">:
<br><font size=2 face="sans-serif">So how do I register this Type Handler?</font>
<br><font size=2 color=#008080 face="Courier New">&lt;</font><font
size=2 color=#3f8080 face="Courier New">typeHandler
</font><font size=2 color=#800080 face="Courier New">javaType</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;?&quot;
</font><font size=2 color=#800080 face="Courier New">jdbcType</font><font
size=2 face="Courier New">=</font><font size=2 color=#4200ff face="Courier New">&quot;LONGVARCHAR&quot;</font>
<br><font size=2 color=#4200ff face="Courier New">Thanks...</font>

View raw message