ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Re: "encoding not supported"-error using iBATIS with db2 on z/os
Date Wed, 21 Nov 2007 20:08:51 GMT

<br><font size=2 face="sans-serif">In addition, I've worked with DB2 previously
on a z/OS system utilizing the type driver supplied by IBM. The database
was expecting EBCDIC and the data I was working with in the Java world
was ASCII coming in from an XML document encoded in UTF-8. The JDBC driver
did a marvelous job of converting the ASCII to EBCDIC for me without me
even needing to think about it. However, one thing that you must be aware
of is that there are ASCII characters that do not map to EBCIDIC characters
and there are EBCDIC characters that do not map to ASCII characters. This
is something that I spent a great deal of time on, trying to map some obscure
characters to the back-end system because it was required. The end result
was utilizing triggers to get around some of the issues.</font>
<br>
<br><font size=2 face="sans-serif">Anyway, just be aware of the character
mapping between the two encoding.</font>
<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 Lamey &lt;clamey@localmatters.com&gt;</b>
</font>
<p><font size=1 face="sans-serif">11/21/2007 11:39 AM</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 valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">&lt;user-java@ibatis.apache.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: &quot;encoding not supported&quot;-error
using iBATIS with db2 on z/os</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>You'd have to look at every character of every parameter
to find the problem<br>
character, so looking at a few in the debugger doesn't mean much. &nbsp;Plus
it<br>
could be that they are valid UTF-8 characters, which would be fine in Java,<br>
but the db isn't setup for that encoding.<br>
<br>
Running the program on z/os will use the default encoding of the os, which<br>
is most likely the same as the db encoding.<br>
<br>
I don't know much about DB2 and even less about z/OS, but it looks like
you<br>
can use either UNICODE, ASCII, or EBCDIC. &nbsp;This is specified on source
and<br>
target table creation:<br>
<br>
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.<br>
db2.ii.doc/admin/te0x0002.htm<br>
<br>
So you need to figure out the encoding of your db. &nbsp;My guess is that
it's<br>
either ASCII or EBCDIC.<br>
<br>
Then you need to look at the encoding of the source data for your<br>
parameters. &nbsp;Is it from a flat file or from another db?<br>
<br>
Once you know where the encoding disconnect is, you can then figure out
what<br>
to do about it.<br>
<br>
Cheers,<br>
Chris<br>
<br>
On 11/21/07 12:15 PM, &quot;Ralf Assmann&quot; &lt;ralf.assmann@innovations.de&gt;
wrote:<br>
<br>
&gt; <br>
&gt; If I debug the code, the parameters to the sqlmap can be read, so
in<br>
&gt; Java there seems not to be an encoding problem. If we are running
our<br>
&gt; programm on z/os itself, the error also does not occur.<br>
&gt; <br>
&gt; Ralf<br>
&gt; <br>
&gt; <br>
&gt; Christopher Lamey schrieb:<br>
&gt;&gt; It looks like the parameters to the sqlmap are in an encoding
that the db<br>
&gt;&gt; doesn't support. &nbsp;Most likely an extended character in one
encoding that<br>
&gt;&gt; isn't valid in another.<br>
&gt;&gt; <br>
&gt;&gt; What encoding is the db using?<br>
&gt;&gt; <br>
&gt;&gt; What encoding are the parameters coming in from? &nbsp;Java will
use UTF-8<br>
&gt;&gt; internally, but if you're reading data from a file encoded with
windows-1252<br>
&gt;&gt; there could be a character causing trouble.<br>
&gt;&gt; <br>
&gt;&gt; On 11/21/07 10:08 AM, &quot;Ralf Assmann&quot; &lt;ralf.assmann@innovations.de&gt;
wrote:<br>
&gt;&gt; <br>
&gt;&gt; &nbsp; <br>
&gt;&gt;&gt; Hi there,<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; we have the following problem using iBATIS on a local machine
(win2000)<br>
&gt;&gt;&gt; connecting a database at a remote host (db2 on z/os). We are
using a jcc<br>
&gt;&gt;&gt; type 4 driver of IBM.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; While calling the ...queryForList(...)-methode of iBATIS -<br>
&gt;&gt;&gt; queryForObject(...) will bring the same result/error -, the
following<br>
&gt;&gt;&gt; error occurs:<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; --- The error occurred in &lt;xml-file&gt;<br>
&gt;&gt;&gt; --- The error occurred while applying a parameter map.<br>
&gt;&gt;&gt; --- Check the &lt;statement&gt;-InlineParameterMap.<br>
&gt;&gt;&gt; --- Check the statement (query failed).<br>
&gt;&gt;&gt; --- Cause: com.ibm.db2.jcc.b.DisconnectException: encoding
not<br>
&gt;&gt;&gt; supported!! &nbsp;DB2ConnectionCorrelator: GA6F0608.G460.C188390D477C<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; The iBATIS-error itself occurs in method executeQuery(...)
of class<br>
&gt;&gt;&gt; SqlExecutor.class at line &quot;ps.execute();&quot;.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Using the same driver while preparing an own prepared statement
and<br>
&gt;&gt;&gt; executing it (plain jdbc without iBATIS), everythings works
well and the<br>
&gt;&gt;&gt; result will be delivered. So it seems not to be a driver error
...<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Does anyone has an idea what happens there?<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Many thanks.<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; Ralf<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; &nbsp; &nbsp; <br>
&gt;&gt; <br>
&gt;&gt; &nbsp; <br>
<br>
<br>
</tt></font>
<br>

Mime
View raw message