You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Frank Nguyen <fr...@sbcglobal.net> on 2004/03/03 20:04:22 UTC

FW: java.sql.SQLException: Unable to connect to any hosts due to exception: Connection rejected

Hi,

I kept getting the JDBC connection problem with mysql when running 'ant -f
build-torque.xml create-db'. I tried both localhost and remote. I was able
to connect using 'mysql -h 'localhost|remotename' -u root'. There must be
something wrong, either with the jdbc driver, or the config files
(attached). I have mysql-connector-java-3.0.9-stable-bin.jar installed under
/torque/lib and j2sdkx.x.x/jre/lib/ext. Did I miss something else ?

Thanks,

Frank Nguyen


BUILD FAILED
file:D:/torque-gen-3.1/build-torque.xml:292: java.sql.SQLException: Unable
to
nnect to any hosts due to exception: java.net.ConnectException: Connection
re
ed: connect
        at
org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java
2)
        at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:358)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

RE: java.sql.SQLException: Unable to connect to any hosts due to exception: Connection rejected

Posted by Luca Zappa <lu...@lucazappa.com>.
Hi Frank,
tell us more about build.properties, there is probably some mistakes in the
torque.database.createUrl property. 
It must be something like this:
torque.database.createUrl = jdbc:mysql://127.0.0.2/mysql

You must specify an existent database in createUrl (mysql).


Bye
  Luca

-----Original Message-----
From: Frank Nguyen [mailto:franktnguyen@sbcglobal.net] 
Sent: Wednesday, March 03, 2004 8:04 PM
To: Apache Torque Users List
Subject: FW: java.sql.SQLException: Unable to connect to any hosts due to
exception: Connection rejected


Hi,

I kept getting the JDBC connection problem with mysql when running 'ant -f
build-torque.xml create-db'. I tried both localhost and remote. I was able
to connect using 'mysql -h 'localhost|remotename' -u root'. There must be
something wrong, either with the jdbc driver, or the config files
(attached). I have mysql-connector-java-3.0.9-stable-bin.jar installed under
/torque/lib and j2sdkx.x.x/jre/lib/ext. Did I miss something else ?

Thanks,

Frank Nguyen


BUILD FAILED
file:D:/torque-gen-3.1/build-torque.xml:292: java.sql.SQLException: Unable
to nnect to any hosts due to exception: java.net.ConnectException:
Connection re
ed: connect
        at
org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java
2)
        at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:358)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org