This demo contains an example program that shows how to use Hibernate JPA with native MySQL connections to connect from Google App Engine to Google Cloud SQL both in development mode and on App Engine.
- Apache Maven 3.0 or greater
- a local MySQL server (for running locally with devserver)
- JDK 7+
Clone this repository to a local directory. Maven will download all the other dependencies.
To build, run:
mvn package
Make sure the demo
database exists on the local MySQL server.
To start the app, use the App Engine Maven Plugin that is included in this demo. Just run the command:
mvn appengine:devserver
In pom.xml
update the following properties:
appengine.app.appId
to point to your App Engine application IDcloudsql.url
to point to your Cloud SQL instance by replacingyour-instance-name
with the full name of your instance (this looks either likemy_project:my_instance
for non-domain specific instances or likemy_domain:my_project:my_instance
for the domain-specific ones).
Make sure the demo
database exists on the Cloud SQL instance.
To deploy the app run the following command:
mvn appengine:update
- See CONTRIB.md
- See LICENSE