commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25762] New: - SharedPoolDataSource getConnection() throws ClassCastException
Date Fri, 26 Dec 2003 02:36:31 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25762>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25762

SharedPoolDataSource getConnection() throws ClassCastException

           Summary: SharedPoolDataSource getConnection() throws
                    ClassCastException
           Product: Commons
           Version: 1.1 Final
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: akhayyat@ccse.kfupm.edu.sa


Hi there,
I am trying to develop a database webapplication using tomcat 5.0.16 with mysql 
3.23.54 on redhat 9 linux.

BasicDataSource works just fine until I try to swith the user credintials, i.e. 
getConnection(String username, String password) does not work. It throws 
UnsupportedOperation exception by definition.

That is when I browsed the commons-dbcp looking for something else to find 
SharedPoolDataSource that, as far as I understood, works on top of other pool 
like BasicDataSource. When I tried to implement this, I got the following 
exception when trying to call getConnection():
java.lang.ClassCastException
	org.apache.commons.dbcp.datasources.InstanceKeyDataSource.testCPDS
(InstanceKeyDataSource.java:738)
	org.apache.commons.dbcp.datasources.SharedPoolDataSource.registerPool
(SharedPoolDataSource.java:236)
	org.apache.commons.dbcp.datasources.SharedPoolDataSource.getPooledConnec
tionAndInfo(SharedPoolDataSource.java:205)
	org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection
(InstanceKeyDataSource.java:676)
	org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection
(InstanceKeyDataSource

which is, obviously, internal to commons-dbcp. The JNDI lookup works just fine. 
It is only the getConnection().

I am using a BasicDataSourceFactory to generate DataSource objects which I use, 
in turn, as dataSourcName parameter to the SharedPoolDataSourceFactory 
generating SharedPoolDataSource objects. I look up only the 
SharedPoolDataSource object and call its getConnection() method and there you 
go. ClassCastException!

PS. If there is another way of being able to swith connection credintials it 
would be helpful, too.

Thanks,
Ahmad

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message