Tuesday, March 26, 2013

Re: Loading mysql JDBC jar file -

I found some other posts about this issue;

http://stackoverflow.com/questions/8952696/java-google-app-engine-and-google-cloud-sql-running-on-local-dev-server

Isn't this issue still fixed? 

Op donderdag 1 maart 2012 00:30:26 UTC+1 schreef Brian Duff het volgende:
Are you following the instructions in the documentation?


Brian

On Tue, Feb 28, 2012 at 7:22 PM, shiv <shiv...@gmail.com> wrote:
I'm running my app locally, to test out connection to my new CloudSQL
Instance.

I'm loading the JDBC Driver in my code:
       DriverManager.registerDriver(new AppEngineDriver());
                       Connection c = DriverManager
                                       .getConnection("jdbc:google:rdbms://<projectName>:<InstanceName>/
<DBName>");

On executing locally, I get this error:

   java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Caused by:
java.lang.IllegalStateException: java.lang.ClassNotFoundException:
com.mysql.jdbc.Driver

On forums, I read this:
"Google App Engine doesn't allow you to open Sockets. When you try to
load the JDBC driver, it makes a socket connection in a static block.
An exception in the static block leads to a ClassNotFoundException,
which is what you are seeing..."

Mysql-connector-java-5.1.18-bin.jar is in my Eclipse Build path.

What is the workaround to the Sockets issue in GAE?

In this appengine how-to section for cloudSQL, I don't find any
special reference to taking care of this situation:
https://developers.google.com/cloud-sql/docs/developers_guide_java#register_the_driver

Any pointers greatly appreciated!

Thanks,
 -Shiv

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment