Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2008

Tip: Looking for answers? Try searching our database.

tonmcat and connection pooling

Thread view: 
josh - 05 Feb 2008 09:25 GMT
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
josh - 05 Feb 2008 10:00 GMT
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!
Lew - 05 Feb 2008 13:44 GMT
> again! the error now is the following:
>
[quoted text clipped - 3 lines]
> 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.

Signature

Lew

josh - 06 Feb 2008 11:31 GMT
> > again! the error now is the following:
>
[quoted text clipped - 26 lines]
> --
> Lew

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.