1

I am using Cloud SQL in my android app,everything works fine but some times cloud sql doesn't respond. I am unable to access the database through app with the following error

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

And at the same time the database is accessible through Local MySQL Instance running in my PC. Please Help

apesa
  • 12,163
  • 6
  • 38
  • 43
emergence
  • 11
  • 1
  • Not an answer but we never try to connect to database directly. The best way to connect to database is via an API instead of accessing directly. Other than performance issues, security wise it's very easy to decompile application and get database username and password. – Sharjeel Oct 13 '15 at 02:13
  • Is it sometimes or all the time that your Cloud SQL will not connect. – apesa Oct 13 '15 at 02:32
  • @apesa sometimes only it is not getting connected and after few minutes or sometimes few hours it gets connected – emergence Oct 13 '15 at 03:27
  • @sharj can you please site an example how can that be done in case of cloud sql – emergence Oct 13 '15 at 03:31
  • @emergence Please read: http://stackoverflow.com/questions/15853367/jdbc-vs-web-service-for-android If you are using Google Cloud SQL - it may help to read: https://cloud.google.com/solutions/mobile/how-to-build-mobile-app-with-app-engine-backend-tutorial/ – Morrison Chang Oct 13 '15 at 04:11

0 Answers0