Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Websphere Connection Pooling / As400 problem

Status
Not open for further replies.

ChrisRoper

Programmer
Nov 27, 2002
1
GB
Hi

We have an application that takes data from an AS/400. The problem we are facing is that the files on the AS/400 are CCSID 65535 - this means data comes back garbled.

Now, by adding the property 'translate binary=true' the problem can be fixed... however, I can only apply this parameter when making connections myself. Code example:

>>

Properties p = new Properties();

p.put("translate binary", "true");

AS400JDBCDriver d = new AS400JDBCDriver();

AS400 o = new AS400(propAS400, propUserID, propPassword);

conn = d.connect(o, p, null);

>>

If I use the Websphere connection pooling (and need to as it is far more efficient), I can't add the parameter. Code example:

>>

Hashtable parms = new Hashtable();

parms.put(Context.INITIAL_CONTEXT_FACTORY, ("com.ibm.websphere.naming.WsnInitialContextFactory"));

Context ctx = new InitialContext(parms);

ds = (javax.sql.DataSource) ctx.lookup("jdbc/" +
propDataSource);

connection = ds.getConnection(propUserID, propPassword);

>>

I've tried all sorts of things but without any luck. All suggestions welcome!
 
There is AS400 specific Datasource class
"com.ibm.as400.access.AS400JDBCDataSource"
that class set method setTranslateBinary(boolean).

Try as400 JTOPEN's javadoc for that class
there are some example of how to use a datasource using AS400JDBCDataSource.


 
Hi,
I am trying to obtain javax.sql.DataSource for SQL Server 2000, using WSAD 5.0 tool.

I try to run this code:
>>
Hashtable parms = new Hashtable();

parms.put(Context.INITIAL_CONTEXT_FACTORY, ("com.ibm.websphere.naming.WsnInitialContextFactory"));

Context ctx = new InitialContext(parms);

ds = (javax.sql.DataSource) ctx.lookup("jdbc/" +
propDataSource);

connection = ds.getConnection(propUserID, propPassword);
>>
but I get NamingException:
javax.naming.ConfigurationException: Malformed provider URL: corbaloc:iiop:localhost ; message = Malformed provider URL: corbaloc:iiop:localhost

what should I give as the Context.PROVIDER_URL ?
>>
parms.put(Context.PROVIDER_URL, "??????");
>>
Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top