|
java400-l-bounces+markp=softlanding.com@xxxxxxxxxxxx wrote on 12/08/2005 09:41:41 AM: > I've got a JDBC statement that is getting the following error ... > > java.sql.SQLException: [SQL0113] Le nom TRJOB# n'est pas admis. > > Which translates into: Name TRJOB# not allowed. > > My gut says this is a code page or CCSID problem (the system is running > in France). > > Is there a JDBC property I can set that will let me query that table > without having to change the column name in the table? > > I found the 'package ccsid' property ... but I'm not really sure what an > appropriate value would be. I think it is definitely a CCSID problem. I ran into this a while back so my memory might be fuzzy, but what I think I figured out was that the field name was stored in the database object with the hex value of # from my systems (EBCDIC 37). When you run the query in a different code page the # comes from that code page and SQL does not find a match for the field name. To solve the problem I created a table that was keyed by an integer and had a 1-char field with CCSID 65535. I then added rows for a bunch of special characters. I then made a small Java class that will query this file and return the character. I already had a common "Connection" class that manages my JDBC connection and that I pass around to all my data access class. I just added a getPoundChar() method in this class. Any class that needs this character just calls this method and uses it in concatenation to build the field name for the SQL query string. The "Connection" class caches the value of the character internally so that the query only has to be run one time. That solved it for me. Mark _____________________________________________________________________________ Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by IBM Email Security Management Services powered by MessageLabs. _____________________________________________________________________________
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.