Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JNDI DataSource on Tomcat 4.1.27

843854Oct 27 2003 — edited Oct 27 2003
I am running Tomcat 4.1.27 with JVM 1.3.1_07-b02 on WinXP and I am trying to connect to an Oracle 9i database. I have a datasource setup and when I supply a username and password in the datasource everything connects fine. However, I need to be able to pass the username and password from my application to the datasource for authentication. Whenever I try DataSource.getConnection(username,password) I get an "java.lang.UnsupportedOperationException" exception. I also tried using the BasicDataSource.getConnection(username,password) method with the same results. Here is a bit of the stack trace:

java.lang.UnsupportedOperationException
at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:125)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:329)
at foo.Login.loginSuccess(Login.java:45)

Can I get explicit instructions on what I need to do to be able to pass the username and password to the datasource? Is there another/better way to do this? Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2003
Added on Oct 27 2003
4 comments
281 views