LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   JDBC mysql url parameter for tomcat's server.xml (https://www.linuxquestions.org/questions/linux-software-2/jdbc-mysql-url-parameter-for-tomcats-server-xml-152226/)

gschrade 03-01-2004 11:11 AM

JDBC mysql url parameter for tomcat's server.xml
 
This question is for those who know tomcat and mysql. I am using Red Hat 9, Tomcat 5.0.16 and mySql 3.5x. In server.xml, I entered a JDBC resource for a mysql database. I have (among others) parameters for url, user, and password. When I try to query the database via JDBC in a servlet, I get "Access denied for user: nobody@mymachine.mydomainname (Using password: YES). I am not using the nobody user. It seems that it is not picking up the user/password, I am not sure. Am I missing something?

Here is the relevant entries in server.xml:

<Resource name="jdbc/myDatabase"
type="javax.sql.DataSource"
auth="Container"
debug="6"
/>
<ResourceParams name="jdbc/myDatabase"/>
<paramater>
<name>user</name>
<value>someuser</value>
</parameter>
<parameter>
<name>password</name>
<value>somepassword</value>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>
jdbc:mysql://mymachine.mydomain/myDatabase
</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>9</value>
</parameter>
</ResourceParams>

gschrade 03-01-2004 05:07 PM

I found the answer to the problem: user needed to be changed to username.


All times are GMT -5. The time now is 03:33 PM.