You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by mi...@pharma.novartis.com on 2003/04/23 11:13:26 UTC

Poolman Connection Pooling: Set username and pw dynamically?

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!