Are you using the latest connectorJ version? If so change
org.gjt.mm.mysql.Driver to com.mysql.jdbc.Driver


Tom Kochanowicz

-----Original Message-----
From: ilasno [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 08, 2004 9:34 PM
To: [EMAIL PROTECTED]
Subject: unable to connect to mysql db on localhost

hello,

i'm running tomcat 5.0.16 on debian linux with webmin, which provides 
mysql.  i've created a test database, and set up a user with what i 
think are the proper permissions.  here's the datasource resource from 
the server.xml that's nested within a context:

<Resource name="jdbc/dbName" auth="Container" 
type="javax.sql.DataSource" />

      <ResourceParams name="jdbc/dbName">

        <parameter>
            <name>factory</name>
 
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
          </parameter>

        <parameter>
            <name>maxActive</name>
            <value>100</value>
          </parameter>

        <parameter>
            <name>maxIdle</name>
            <value>30</value>
          </parameter>

        <parameter>
            <name>maxWait</name>
            <value>10000</value>
          </parameter>

        <parameter>
            <name>username</name>
            <value>xxxxxx</value>
          </parameter>

        <parameter>
            <name>password</name>
            <value>xxxxxx</value>
          </parameter>

        <parameter>
            <name>driverClassName</name>
            <value>org.gjt.mm.mysql.Driver</value>
          </parameter>

        <parameter>
            <name>url</name>
 
<value>jdbc:mysql://localhost/dbName?autoReconnect=true</value>
          </parameter>

        <parameter>
            <name>removeAbandoned</name>
            <value>true</value>
          </parameter>

        <parameter>
            <name>logAbandoned</name>
            <value>true</value>
          </parameter>
 
      </ResourceParams>

but when i try to access, i get this exception, taken from the logs for 
that context:

2004-06-08 19:18:24 AbandonedObjectPool is used 
([EMAIL PROTECTED])
   LogAbandoned: true
   RemoveAbandoned: true
   RemoveAbandonedTimeout: 300
org.apache.commons.dbcp.SQLNestedException: Cannot create 
PoolableConnectionFactory, cause:
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.ConnectException)
    at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source)

incidentally (or maybe not), i have other datasources configured pretty 
much identically that work fine for another context that are connecting 
to remote mysql servers.

any suggestions?

thanks for your time.

-- 
ilasno


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.682 / Virus Database: 444 - Release Date: 5/11/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.682 / Virus Database: 444 - Release Date: 5/11/2004
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to