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 Phil R Lawrence <pr...@Lehigh.EDU> on 2003/03/13 23:06:27 UTC

connection refusal error...

Thanks for the tips on com.mysql.jdbc.Driver...

Now I am having a connection refusal error.  But I can connect with the 
username and password stored in build.properties and Torque.properties.

Witness the following:

[torque-3.0]# grep adminuser build.properties Torque.properties
build.properties:torque.database.user = torque_adminuser
build.properties:torque.database.password = torque_adminuser_password
Torque.properties:torque.database.bookstore.username = torque_adminuser
Torque.properties:torque.database.bookstore.password = 
torque_adminuser_password

[torque-3.0]# mysql -utorque_adminuser -ptorque_adminuser_password
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 26 to server version: 3.23.52

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> exit
Bye

[torque-3.0]# ant -f build-torque.xml create-db
Buildfile: build-torque.xml

create-db-check:

create-db:
[torque-data-model] Generating to file 
/usr/local/torque-3.0/src/sql/create-db.sql
[torque-data-model] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package
[torque-data-model] Resolver: used 
http://jakarta.apache.org/turbine/dtd/database_3_1.dtd
      [echo]
      [echo]       Executing the create-db.sql script ...
      [echo]

BUILD FAILED
file:/usr/local/torque-3.0/build-torque.xml:302: java.sql.SQLException: 
Unable to connect to any hosts due to exception: 
java.net.ConnectException: Connection refused

Total time: 3 seconds


Re: connection refusal error...

Posted by Dan Allen <da...@mojavelinux.com>.
> Witness the following:
> 
> [torque-3.0]# grep adminuser build.properties Torque.properties
> build.properties:torque.database.user = torque_adminuser
> build.properties:torque.database.password = torque_adminuser_password
> Torque.properties:torque.database.bookstore.username = torque_adminuser
> Torque.properties:torque.database.bookstore.password = 
> torque_adminuser_password

Ah yes, now you are running into the error in the tutorial.  What
you see on the web is wrong.  Please bitch about this because it
doesn't seem that anyone cares to want to fix it, which is probably
detering people from using Torque.  Don't give up, this list is
going to have at least me reading it from time to time, so if your
experience follows mine, I should have some answers.

Here is my grep:

> build.properties (relevant portion)

torque.project = bookstore
torque.database = mysql
torque.targetPackage = net.creativerge.model
torque.database.createUrl = jdbc:mysql://localhost/mysql
torque.database.name = dallen
torque.database.buildUrl = jdbc:mysql://localhost/dallen
torque.database.url = jdbc:mysql://localhost/dallen
torque.database.driver = com.mysql.jdbc.Driver
torque.database.user = rootuser
torque.database.password = PaSsWoRd
torque.database.host = localhost

> torque.properties (relavant portion)

torque.database.default = dallen
torque.database.dallen.adapter = mysql
torque.dsfactory.dallen.factory = org.apache.torque.dsfactory.TorqueDataSourceFactory
torque.dsfactory.dallen.pool.defaultMaxConnections = 10
torque.dsfactory.dallen.pool.maxExpiryTime = 3600
torque.dsfactory.dallen.pool.connectionWaitTimeout = 10
torque.dsfactory.dallen.connection.driver = com.mysql.jdbc.Driver
torque.dsfactory.dallen.connection.url = jdbc:mysql://localhost/dallen
torque.dsfactory.dallen.connection.user = webuser
torque.dsfactory.dallen.connection.password = PaSsWoRd

So the name of my database is 'dallen,' which is my unix username.
Whereever you see 'dallen,' fill that in with your database name.
Then change any username/password references to your own.  The first
script (build.properties) should be the admin database user and the
torque.properties is your web database user.

I am not sure which lines of those are overkill, but it works for
me.  It would be nice if the tutorial could sort all these details
out seeing how they are the most important part of getting the whole
thing running.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
[Frodo]: "I wish it need not have happened in my time." 
[Gandalf]: "So do I, and so do all who live to see such times. 
But that is not for them to decide. All we have to decide is 
what we do with the time that is given to us.'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -