Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2006

Tip: Looking for answers? Try searching our database.

db2 database returns ebcdic

Thread view: 
John Smith - 14 Sep 2006 12:30 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?

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.