ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Re: TypeHandlerCallBack javaType for byte[]
Date Mon, 17 Sep 2007 18:56:35 GMT

<br><font size=2 face="sans-serif">Just for future reference, to get this
to work the proper javaType definition is &quot;</font><font size=2 face="Courier
New">[B</font><font size=2 face="sans-serif">&quot;.
This will allow the ClassLoader to instanciate a Class of type byte[].</font>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Chris Mathrusse<br>
christopher.mathrusse@sybase.com<br>
Sybase, Inc<br>
One Sybase Drive<br>
Dublin, CA 94568<br>
(925) 236-5553</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Christopher.Mathrusse@sybase.com</b>
</font>
<p><font size=1 face="sans-serif">09/14/2007 02:32 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
user-java@ibatis.apache.org</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">&quot;ibatis user&quot;
&lt;user-java@ibatis.apache.org&gt;</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">TypeHandlerCallBack javaType
for byte[]</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
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><font size=3><br>
</font><font size=2 face="sans-serif"><br>
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><font size=3> <br>
</font><font size=2 color=#000080 face="Courier New"><u><br>
java.lang.ClassNotFoundException</u></font><font size=2 face="Courier New">:
byte[]</font><font size=3> <br>
<br>
</font><font size=2 face="sans-serif"><br>
So how do I register this Type Handler?</font><font size=3> <br>
</font><font size=2 color=#008080 face="Courier New"><br>
&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><font
size=3>
<br>
</font><font size=2 color=#4200ff face="Courier New"><br>
Thanks...</font><font size=3> </font>
<br>

Mime
View raw message