Umesh Bhatt wrote:
Hi,

Sorry I meant auth not Auth.  Thanks for correction.
I used getConnection(username, password) but it gives me an error as "It is not 
supported" and doesn't connect with DB.


Umesh,

you would help the people trying to help you, and thus help yourself get answers faster, by providing *precise* information about your problem. If you do not provide precise information, and do not answer questions, it is more difficult to help you. And since the people who try to help on this list do this on their free time, and also have other things to do (like another $$ job for instance), they will not feel very motivated to spend extra time getting the information out of you.

Something like "an error as "It is not supported"" does not help. Copy and paste the *real* error messages.
And answer the questions of Charles below.

here is an example of a "good" post :
http://markmail.org/message/ik56qyngekis24bo


-----Original Message-----
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
Sent: Thursday, June 09, 2011 10:44 AM
To: Tomcat Users List
Subject: RE: Auth in Context.xml

From: Umesh Bhatt [mailto:umesh_bh...@mindtree.com]
Subject: RE: Auth in Context.xml

I am using Tomcat 6.0.

6.0.what?  There are 32 versions of 6.0; be precise.

In Context.xml file

Again, if you have a file named Context.xml, it will be ignored.  Files must be 
named (and located) properly for Tomcat to use them.  Exactly what is the file 
name, where is it located, and what are the full contents of the file?

I found JDBC resource configuration as below.

<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
               maxActive="100" maxIdle="30" maxWait="10000"
               username="javauser" password="javadude" 
driverClassName="com.mysql.jdbc.Driver"
               url="jdbc:mysql://localhost:3306/javatest"/>

It has Auth attribute

No, it has an auth attribute, not Auth; everything here is case-sensitive, so 
get it right.

I don't want to use tomcat to setup connection rather want my
application to setup connection with DB.

Still fooling yourself into thinking it's safer to bury the password in the 
application than in the configuration file?  Waste of time.  But if you insist 
on doing it, use the getConnection() method that has userid and password as 
arguments.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


________________________________

http://www.mindtree.com/email/disclaimer.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to