: MIDRANGE dot COM Mailing List Archive

JDBC native driver/code page conversion


AddThis Feed Button


I'm using the native AS/400 JDBC driver. The following code works fine:

------------------------------------------------
query = "SELECT * FROM GDPF WHERE GDUSID=?";
pstmt = con.prepareStatement(query);
pstmt.setString(1, equser);
rs = pstmt.executeQuery();

while (rs.next()) {

String option = rs.getString("GDOID");
.
.
.
------------------------------------------------

but when I replace "SELECT *" with "SELECT GDOID" (that's the only field of
the result set I'm actually interested in) rs.getString("GDOID") returns a
garbled value (it looks like it's not properly converted from EBCDIC,
although I may be wrong). CCSID of the file is set to 37 but no specific
CCSID was defined for GDOID field. CCSIDs of the system and the jobs
involved are all set to 37.

What's wrong? Or could it be that the driver is working as designed?

Lo




Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2007 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact

.

counter