Unable to connect database of lamp instance from servlet running on tomcat instance of google cloud

20 views
Skip to first unread message

Yaswanth Sai

unread,
Jun 9, 2015, 2:02:41 PM6/9/15
to google-a...@googlegroups.com

Hello guys,

I have two instances of my project running on Google's cloud, Tomcat Instance & Lamp Instance.

My servlets are running on tomcat instance and have to connect to the database of lamp instance.

I gave the following details of connection

String DriverName="com.mysql.jdbc.Driver";
String userName="root";
String password="root";
String driverManager="jdbc:mysql://localhost:3306/databasename";

The localhost request is going to mysql of tomcat instance(Here tomcat instance contains mysql also).It is not going to the lamp instance

So I want a way to send request to another instance.

if I placed lamp instance url means i am receiving the following exception in the logcat.

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

So can anyone tell how to solve this problem

thanks in advance.

Reply all
Reply to author
Forward
0 new messages