I am running a PreparedStatement query against a DB2 database on a mainframe
and it is returning EBCDIC strings to me. How can I get the query to return
ASCII strings?
Thanks
Jon
joeNOSPAM@BEA.com - 14 Sep 2006 15:15 GMT
> I am running a PreparedStatement query against a DB2 database on a mainframe
> and it is returning EBCDIC strings to me. How can I get the query to return
[quoted text clipped - 3 lines]
>
> Jon
getString() and getAsciiStream() are the calls you should use to
retrieve character data, and should convert whatever you get to Java
strings.
Joe Weinstein at BEA Systems
Thomas Kellerer - 14 Sep 2006 17:40 GMT
John Smith wrote on 14.09.2006 13:30:
> I am running a PreparedStatement query against a DB2 database on a mainframe
> and it is returning EBCDIC strings to me. How can I get the query to return
> ASCII strings?
I once had problems with DB2's JDBC driver because the JDK/JRE we were using did
not have the charsets.jar included which is apparently needed for the conversion.
You might want to check if that file is present in your JDK/JRE
Thomas
Arne Vajhøj - 15 Sep 2006 00:05 GMT
> I am running a PreparedStatement query against a DB2 database on a mainframe
> and it is returning EBCDIC strings to me. How can I get the query to return
> ASCII strings?
If
rs.getString(colix)
does not work even though it should then try
new String(rs.getBytes(colix), "Cp1047")
or
new String(rs.getBytes(colix), "Cp037")
Arne