users@glassfish.java.net

Re: good explanation for meaning of Connection Pool resource types

From: <glassfish_at_javadesktop.org>
Date: Tue, 04 Mar 2008 20:13:36 PST

Richard,

Could you please paste a code snippet how you used ConnectionPoolDatasource ?
As i'm facing same issue I have the datasource classname and resource type set to Oracle connectionPoolDatasource and Javax.sql.ConnectionPoolDataSource
but then it always return DataSource when I lookup the connectionpool it does not return ConnectionPoolDataSource so that i can getPooledConnection instead of DataSources getConnection ().I've set the connection pool from admin console and web.xml has javax.sql.ConnectionPoolDataSource even then I get type cast exception at the line2 as it returns DataSource type only.

1.Context ctx = new InitialContext();
2.ConnectionPoolDataSource cpds = (ConnectionPoolDataSource)ctx.lookup("jdbc/AIP_TEST");
3.PoolConnection pc = cpds.getPooledConnection();
4.Connection conn = pc.getConnection();

thanks,
MD
[Message sent by forum member 'md7777' (md7777)]

http://forums.java.net/jive/thread.jspa?messageID=262337