tonmcat and connection pooling

J

josh

Hi, finally after many time I've configured a pool manager under
Tomcat. Now I have a question:

in the <Resource> element I write the attributes username, password
but in my application I want that
the user pass it dinamically so I removed them and I write in the
attribute auth="Application" but If I use the following method:

Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup( "jdbc/test" );
conn = ds.getConnection(user, pass);

I have the following error:

MESSAGE: Access denied for user ''@'localhost' (using password: NO)

Any idea?

or how can I get that attributes values so I can check with those
dinamically passed?

Thanks
 
J

josh

again! the error now is the following:

java.lang.UnsupportedOperationException: Not supported by
BasicDataSource

it seems as getConnection(user,name) is not supported by the dbcp
class....in Tomcat 6

Help!
 
L

Lew

josh said:
again! the error now is the following:

java.lang.UnsupportedOperationException: Not supported by
BasicDataSource

it seems as getConnection(user,name) is not supported by the dbcp
class....in Tomcat 6

That's a different error from the first one
MESSAGE: Access denied for user ''@'localhost' (using password: NO)

The "access denied" error looks like it came from MySQL. You don't say what
DBMS you're using. If MySQL, doesn't MySQL have to be set up differently with
usernames from localhost and usernames not from localhost?

The username it's reporting is '', implying that no database username was
submitted.

You don't show us how "jdbc/test" is defined, so we can't confirm that for you.

The definition of "jdbc/test" is also implicated in the message that reports
the problem wih "BasicDataSource". You don't tell us what operation is
unsupported, but it looks that way.

Seems from here with the limited information available that you defined your
data source incorrectly.
 
J

josh

That's a different error from the first one


The "access denied" error looks like it came from MySQL. You don't say what
DBMS you're using. If MySQL, doesn't MySQL have to be set up differently with
usernames from localhost and usernames not from localhost?

The username it's reporting is '', implying that no database username was
submitted.

You don't show us how "jdbc/test" is defined, so we can't confirm that for you.

The definition of "jdbc/test" is also implicated in the message that reports
the problem wih "BasicDataSource". You don't tell us what operation is
unsupported, but it looks that way.

Seems from here with the limited information available that you defined your
data source incorrectly.

I found that the error was that getConnection(u,p) with passing that
two arguments is not
implemented in the DBCP package...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top