tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michael.hunzi...@pharma.novartis.com
Subject Poolman Connection Pooling: Set username and pw dynamically?
Date Wed, 23 Apr 2003 09:13:26 GMT
Hi!

I've got some questions about PoolMan!

First, my poolman.xml looks like this:
....
<datasource>
<dbname>myDataBase</dbname>
<jndiName>jndi-myDataBase</jndiName>
<driver>oracle.jdbc.driver.OracleDriver</driver>
<url>jdbc:oracle:oci8:@myDataBase</url>
<username></username>
<password></password>
</datasource>
...

As you can see, i didn't set a userName and a password! That's because i 
want to set them dynamically during runtime!
I thought I could open my connection using ds.getConnection() and passing 
the userName and the password! Like this:

DataSource ds = PoolMan.findDataSource(getDBName());
con = ds.getConnection(USERNAME, PASSWORD);


BUT IT DOESN'T WORK!
I ALWAYS GET THE ERROR "USERNAME OR PASSWORD INVALID"!!! So these two 
parameters don't seem to work!

How do i have to implement Poolman if want to set the username and 
password for a database dynamically (not permanently in the poolman.xml)?



please help me!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message