• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC - As/400 CCSID = 65535 problem

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I'm hitting the problem where data taken from the AS/400 is displayed as hex/garbage because the file on the AS/400 has a CCSID of 65535.
I've looked around on the net and found a solution, although I've been unable to get it working.
The solution is to basically add a property 'convert binary=true' on to the end of the database URL.
I've tried just adding it to the AS/400 IP address in by WAS datasource, but I can't get a connection.
I've set up a datasource in WAS(4.0.4), and my java code uses this datasource to get the connection. I need to specify the 'convert binary=true' property but don't know how to do it.
Any help greatly appreciated!
Cheers,
Chris
 
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Add it as an property to the datasource.
 
Chris Roper
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Simon Song:
Add it as an property to the datasource.


I already tried that - I get the old "Could not find the property convert binary on class..." error message. From what I've seen on various lists looking around on the internet, 'convert binary' isn't a valid property.
Am I missing something?
 
Simon Song
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
>Property is "translate binary=true"
>
>As in the URL
> "jdbc b2:localhost;translate binary=true"
>
>or you could put it in the connection properties object that gets passed on
>the connect methods.
>
>BTW: Its is a feature. ;-) Without some way to represent binary data you
>would not be able to serial java objects and put them into the database
>without data translation happening to them. Also, you could not optimize
>out data translation by putting raw UTF-8 data in the database.
>
>I know... its a little annoying, but its a necessary evil (for now anyway).
>I would like to see the keyword binary and varbinary available on the
>system (and have it used as a real data type - not just a mask over the top
>of CHAR FOR BIT DATA. Maybe someday, but probably not someday soon.
>
>Regards,
>
>Richard D. Dettinger
>AS/400 Java Data Access Team
 
Chris Roper
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help Simon.
I couldn't get the code I had to work. But I changed the way the connection was being made. The code was getting a datasource from WAS and using this to make the connection, but I changed it to get a connection using an IP address stored in a properties file. This was using different drivers, and I was quite easily able to add the property to it. The facility to at properties just didn't seem to be available when using the datasource.
And I'm aware I typed 'convert' instead of 'translate' - that was just in this posting, not in the code.
So I've got it working, but aren't 100% happy that I had to change all the connection code (the application was written by somebody who has since left our company).
This application is just a demo for a customer, so the fact that it works is fine for now. However, I think my code doesn't use connection pooling and will cause the application to be less efficient.

Cheers,
Chris
[ January 29, 2003: Message edited by: Chris Roper ]
 
Simon Song
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I bet it will be much less efficient, especially under heavy load. For a customer demo, it is just fine.
You'd open a PMR against IBM for this issue, or send email to the As/400 Toolkit developer(you may find their email address in the newsgroup).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic