Please read the disclaimer at the bottom of this e-mail.
I think that's because there's an implicit cast in there, Wouldn't that be this instead?:
AS400JDBCConnection jdbcConnection = (AS400JDBCConnection)((WsJdbcConnection) dataSource.getConnection()).getMetaData().getConnection();
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of James Perkins
Sent: 28 April 2010 19:59
To: Java Programming on and around the iSeries / AS400
Subject: Re: AS400 Object from Container Managed JDBC
No luck.
Tried:
AS400JDBCConnection jdbcConnection = (AS400JDBCConnection) dataSource.getConnection().getMetaData().getConnection();
Got this exception:
java.lang.ClassCastException:
com.ibm.ws.rsadapter.jdbc.WSJdbcConnection incompatible with com.ibm.as400.access.AS400JDBCConnection
I might just end-up with a stored procedure, which really isn't a big deal. Just didn't want to define a bunch of stored procedures if I can help it.
--
James R. Perkins
On Wed, Apr 28, 2010 at 11:00, Gary L Peskin <garyp@xxxxxxxxxxxx> wrote:
Hi, James --
I'm confused. Have you tried calling getConnection() on your
WsJdbcDataSource object? If so, what does that return? If that
returns a
WsJdbcConnection() object, try calling getMetaData() on that and then
getConnection() on that and see what you get back.
In other words something like:
WsJdbcDataSource myDataSource = ...;
AS400JDBCConnection conn = (AS400JDBCConnection)
myDataSource.getConnection().getMetaData().getConnection();
AS400 myAs400 = conn.getSystem();
Gary
--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/java400-l.
*****************************************************
Confidentiality: -
This message and any attachments are strictly confidential and may contain legally privileged information.
The contents of the transmission are intended for the named addressee(s) only. If you are not the addressee please do not read, print, store or re-transmit it or any attachments to it. Instead, please email it back to the sender and then immediately permanently delete it from your system
The views or opinions presented here are solely of the author and do not necessarily represent those of Redcats (UK) PLC or any of its subsidiaries.
Redcats (UK) plc. Registered Office: 2 Holdsworth Street, Bradford, BD1 4AH. Registered in England, No. 106691
As an Amazon Associate we earn from qualifying purchases.