I am building a local Spring app to access the database I created on OpenShift at 127.2.xx.yy/eetom:3306
. So I created this propery in Beans.xml
.
<property name="url" value="jdbc:mysql://127.2.xx.yy:3306/eetom"/>
but I got exceptions such as
Could not get JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
and
The driver has not received any packets from the server
So I changed the ip to localhost
and used OpenShift rhc to create port forwarding. And the rhc
showed that the ip I put originally and the port are exactly used for port forwarding. That method workded.
What is the right way to access the mysql diectly without port forwarding?
Someone helped me on this before, it's from OpenShift: OpenShift does not support direct connectivity to an embedded database on non-scalable applications.