RE: connector/j connection to db server via hostname?

"Anthony J. Biacco" <[email protected]> Tue, 3 Feb 2009 15:11:44 -0700
Newsgroups gmane.comp.db.mysql.java
Message-ID <40D5E3C3CBE03D45A776E7C358BDE908E382E2@missoula.formatdynamics.com>
FWIW, if I use the mysql client to do "mysql -h
mysql-cluster-backup-host -P 3307" from the tomcat server, it works
fine.

-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
[email protected]
http://www.formatdynamics.com


-----Original Message-----
From: Anthony J. Biacco [mailto:[email protected]] 
Sent: Tuesday, February 03, 2009 3:10 PM
To: Gerry Matte
Cc: [email protected]
Subject: RE: connector/j connection to db server via hostname?

Hmm, I know the port works with ip addresses because I've tried it.
The connector reference at
http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configurati
on-properties.html seems to state the port and a hostname can be
used..so, I don't know.
I watched for outgoing traffic from the tomcat server for my specified
port of 3307 (and even 3306 for the heck of it) with tcpdump and saw no
traffic.
If I drop the port from the url, still no traffic on either port, in
fact no traffic on any port to any ip for said db connection, which
makes me think it's not resolving the hostname to an ip.

Thanx,

-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
[email protected]
http://www.formatdynamics.com


-----Original Message-----
From: Gerry Matte [mailto:[email protected]] 
Sent: Tuesday, February 03, 2009 3:00 PM
To: Anthony J. Biacco
Subject: Re: connector/j connection to db server via hostname?

Hi Anthony.
hostname and ip address can of course be specified in a hosts file so as
to avoid a DNS lookup.
However I am pretty sure that a port can not be specified.
Gerry Matte
-- 

Gerry Matte, IT Manager, District of Saanich Victoria, BC, Canada
[email protected] Phone: 250-475-5403


>>> On 2/3/2009 at 1:15 PM, in message
<40D5E3C3CBE03D45A776E7C358BDE908E382D8@missoula.formatdynamics.com>,
"Anthony
J. Biacco" <[email protected]> wrote:
> I'm trying to put a hostname in my resource url for the jdbc driver,
> i.e. "mysql-cluster-backup-host:3307". This hostname is in my
/etc/hosts
> file. When the driver tries to failover to this host, i get a
> "org.apache.commons.dbcp.SQLNestedException: Cannot create
> PoolableConnectionFactory (Could not create connection to database
> server. Attempted reconnect 3 times. Giving up.)
> " error.
> If i use the ip in the url, the connection works fine.
> 
> 1. Can i use hostnames from /etc/hosts in the url? If so, what could
be
> the reason connector/j might not be recognizing it?
> 2. Can i get information from the driver in my tomcat log that tells
me
> exactly what host/ip the driver is attempting to connect to?
> 
> Thanx,
> 
> -Tony
> ---------------------------
> Manager, IT Operations
> Format Dynamics, Inc.
> 303-573-1800x27
> [email protected] 
> http://www.formatdynamics.com 
> 
> 
> --
> MySQL Java Mailing List
> For list archives: http://lists.mysql.com/java 
> To unsubscribe:    http://lists.mysql.com/[email protected]


-- 
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:
http://lists.mysql.com/[email protected]


-- 
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/[email protected]