I'm trying to connect to a remote database (hosted on Netfirms www.netfirms.ca if anyone is curious) using hibernate. My mapping file is as follows:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://mysql.netfirms.ca:3306/d60549476</property>
<property name="hibernate.connection.username">u70612250</property>
<property name="hibernate.connection.password">******</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<!-- Use the C3P0 connection pool provider -->
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<!-- List of XML mapping files -->
<mapping resource="customer.hbm.xml"/>
<mapping resource="customerSummary.hbm.xml"/>
<mapping resource="charity.hbm.xml"/>
<mapping resource="charitySummary.hbm.xml"/>
</session-factory>
</hibernate-configuration>
When I start my application, I get the following printout:
16 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
....
94 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
....
485 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
532 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
532 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
547 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
547 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://mysql.netfirms.ca:3306/d60549476
547 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=u70612250, password=****}
168719 [main] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.NoRouteToHostException
MESSAGE: No route to host: connect
STACKTRACE:
java.net.NoRouteToHostException: No route to host: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
I ensured that my database is configured to allow remote access. I'm wondering what causes this. Obviously, I'm unable to establish a connection with the host, but I'm not sure why. Assuming the host name, user, and password are correct, am I missing something?
Addendum: I tried connecting using the same driver with Squirrel, and got the same exact error.