Monday, December 19, 2016

[google-cloud-sql-discuss] Re: Cannot connect to 2nd generation instance from eclipse

Hi,

Sorry for the delay.  Take a look at the updated sample: https://github.com/GoogleCloudPlatform/java-docs-samples/tree/master/appengine/cloudsql -- If you still have trouble, let us know.

Les

On Monday, December 5, 2016 at 9:23:12 AM UTC-8, Vaishnavi Manjunath wrote:
Hi,
   I was able to create sample RESTful application using jersey and jackson and deploy it on GAE. The next thing i want to do is to connect to Google cloud 2nd generation SQL instance which I am unable to do. I will just list steps i followed for better clarity.

1. created a 2nd gen instance associated with GAE project, under root user i changed password.
2. created a database and with help of cloud shell, created a table with 1 record in that database.
3. made a note of instance connection name, database name, username and password.
4. installed mysql installer, was able to install mysql server , command client tool
5. made note of my machine IP address, added it under authorized networks of sql instance.
5. installed mysql-connector-java-5.1.14 jar file , added it to the LIB folder of WEB/INF(added build path)
6. made changes to appengine-web.xml  as per this link: https://cloud.google.com/appengine/docs/java/cloud-sql/
   in both the property name tags i have added instance connection name, dbname, username and password.( i read in few blogs that its not needed in both)- please provide clarity on this and i am not sure what these 
  two tags mean.
7. So after all this, I went to project->google->appengine settings-> enable google cloud sql 
  under this there are three options
  •   mysql instance and google cloud sql instance (i want to know difference between both) and app engine SQL instance
I am not sure which one to configure to test locally and when app is deployed.], more light on local mysql instance would be of great help :)

8. I tried configuring all the three , and ended up getting error:
   

"Could not connect to Profile (test.GoogleCloudSQL.AppEngineInstance).
Error creating SQL Model Connection connection to Profile (test.GoogleCloudSQL.AppEngineInstance). (Error: com.mysql.jdbc.Driver)
com.mysql.jdbc.Driver
Error creating Google Cloud SQL Connection factory connection to Profile (test.GoogleCloudSQL.AppEngineInstance). (Error: com.mysql.jdbc.Driver)
com.mysql.jdbc.Driver"

I did read that this problem exists because jar file is not added, but i have added it as mentioned above.

9. I even installed DTP in eclipse, added new driver connection with MySQL, MySQL jdbc driver and included the same jar file as mentioned above.
I am using GAE version : 1.9.46 , eclipse NEON.
I would also like to mention that I havent written any JDBC code to connect, was exploring this option first as required in: https://developers.google.com/eclipse/docs/cloudsql-createapp#locally

  
So I am absolutely clueless as what to do next, your help will be appreciated  :)

Thanks,
Vaishnavi :)

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/9f8f478d-1ead-4467-86df-6c9ccb7f71c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment