|
Hello! I wrote a similar mail yesterday, but now I found
something. I am using Tomcat v5.5.17, Axis 2 v1.0, MySQL
v5.0.24, MySQL Connector/J v5.0.3 This is how I configured MySQL under Tomcat: 1.: put context information to server.xml: <tomcat
install folder>/conf/server.xml <Context path="/axis2"
docBase="axis2" debug="5"
reloadable="true" crossContext="true"> <Resource name="jdbc/TestDB2"
auth="Container" type="javax.sql.DataSource" maxActive="100"
maxIdle="30" maxWait="100000" username="wsuser"
password="pass" driverClassName="com.mysql.jdbc.Driver" url=""> </Context> 2.: create resource link to the web.xml file at
<tomcat install folder>/webapps/axis2/web-inf/web.xml <resource-ref> <description>DB
Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> This resource works well in a test servlet, but I don’t
how to use it axis2 webservice. My question is: how can I reference this resource
from java code? Context initContext = new InitialContext(); Context envContext =
(Context)initContext.lookup("java:/comp/env"); DataSource ds =
(DataSource)envContext.lookup("jdbc/TestDB"); Connection conn = ds.getConnection(); Is it correct? Thanks, Gábor |
- Tomcat + Axis2 + MySQL Prótár Gábor
- RE: Tomcat + Axis2 + MySQL Sanjesh Pathak
- Re: Tomcat + Axis2 + MySQL Johan Lundberg
