tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ke...@witten-enterprises.com>
Subject Re: Help getting MySQL connected to Tomcat
Date Sun, 24 Feb 2008 17:32:20 GMT
Yes,

In the context.xml I have  <ResourceParams name="jdbc/CurrencyDB">

Also in web.xml I have
   <resource-ref>

        <res-ref-name>jdbc/CurrencyDB</res-ref-name>

        <res-type>javax.sql.DataSource</res-type>

        <res-auth>Container</res-auth>

    </resource-ref>


Thanks,
Kevin


----- Original Message ----- 
From: "Alan Chaney" <alan@compulsivecreative.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Sunday, February 24, 2008 9:11 AM
Subject: Re: Help getting MySQL connected to Tomcat


> kevin@witten-enterprises.com wrote:
>> Thanks for the help. I still don't have this working completely, but 
>> tomcat is now working.
>>
>> I tested mysql and it is using tcp/ip. "mysql -h 127.0.0.1 -u 
>> javauser -p" works fine.
>> Also the MSQLAdmin program shows it is connecting to the correct port 
>> 3306
>>
>
>>            Context init = new InitialContext();
>>
>>            Context ctx = (Context) init.lookup("java:comp/env");
>>
>>            DataSource ds = (DataSource) ctx.lookup("jdbc/CurrencyDB");
> In the previous posts, you have used jdbc/TestDB in your resource 
> defintion. I presume you have changed id?
>
>  <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"/>
>
> </Context>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message