Hey All,
I'm having some difficulty getting Tomcat to establish a connection to
a database and I need a second pair of eyes on this...
Environment:
Windoze XP
Tomcat 4.1
MySQL 3.23.53
MM JDBC Drivers 2.0.14
Global Resource Def (created through /admin):
JNDI Name: jforumdb
URL: jdbc:mysql://localhost/jforum
Driver: com.mysql.jdbc.Driver
web.xml:
<resource-ref>
<res-ref-name>jdbc/jforumdb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
context.xml: (passed in to Tomcat via ant install/reload)
<Context path="/jforum"
docBase="c:/apps/jforum/build"
debug="0">
<ResourceLink name="jdbc/jforumdb" global="jforumdb"/>
</Context>
Code to get a connection:
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)
ic.lookup("java:comp/env/jdbc/jforumdb");
con = ds.getConnection();
Result of getting a connection:
java.sql.SQLException: Cannot connect to MySQL server on
localhost:3306. Is there a MySQL server running on the
machine/port you are trying to connect to?
(java.net.BindException)
I've tried connecting to a Pointbase DB with the same results. I am
able to make a direct connection to any database without any problems
whatsoever. I don't think it's a web-app/Tomcat config issue because
I'm able to get as far as Tomcat *trying* to connect to the DB. So I'm
thinking it's some other config issue. Maybe it's an XP-thing?
Any and all info is appreciated. Thanks!
Jason
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>