Google Cloud SQL with Struts, Spring and Hibernate

With Google App engine SDK 1.5.5, Google have introduced Google Cloud SQL for GAE (Currently we can't connect any other external application with Google Cloud SQL. This can be only with Google App Engine Apps).

It's faster than connecting with Amazon RDS and other Cloud based Data solutions. No need to worry about load balancing as well. Cloud SQL supports 5 QPS read/write rate, so as long as you don't go over that, you can use cloud SQL. If you are going over this read/write rate limit, datastore might become a much more effective approach to you.If you are storing large blobs data(images, attchments and sound files, it's better storing them in the datastore or blobstore.

When Google App Engine became populer in late 2009 many people asked about Hibernate support. But with their datasore people were unable to develop Hibernate support applications with GAE. But with Google Cloud SQL developers can use Hibernate supported applications as well.

Last week I shared my first application which was developed with Google Cloud SQL. It was only a JSP and Servlet based web application. Afterwards I mainly focused on developing a Struts, Spring & Hibernate based application and deploying it to Google App Engine where the data source is Cloud SQL.

In Last weekend I got a time to focus on this idea. So finally I have deployed my Struts, Spring and Hibernate based application in to GAE and it's data source( Database) is Google Cloud SQL. If you are migrating your existing Spring Hibernate based application in to GAE and Cloud SQL, there is not much to do.

Only need to change data source and driver name. If you need more clarification, feel free to contact me.

Try out my application

Source Code(CloudSQLSample2) : 
                                 Backup Link  :

 My Previous Post:
Cloud SQL Doc:

Google App Engine and Cloud SQL will be revolutions of Cloud Computing. (updated 01-11-2011)


mbraginini said…
Searching the web for fresh examples!
Suppose you are the first! :)
Can u add your's spring & hibernate source code to google.code trunk?
mbraginini said…
Searching web for fresh cloud sql examples :) suppose u are the first!
Can u please commit your spring&hibernate source code to google.code trunk?
Anonymous said…
Hi, I've tried to download source code from cloudsql-read-only and I get the error: URL '' doesn't exist

Can you help me?
Anonymous said…
The example you have is very good it helps us a lot , but I am missing all the jar files (libraries), I am trying to use hibernate jpa spring , and facing lot of no such method error , can you please add the jar files or give us pom.xml , this will help us very much .Appreciate your help.
Anonymous said…
hi all, anybody who is getting error in checking out the repository and getting error, that may be because you are trying to use the url "''. Please use the URL only till trunk i.e. "'" if you are not using svn command line tool. :)
code-0men said…
This looks very promising, however I also encounter some ".. no such method" error.

Is it possible for you to post you pom.xml or in any other way specify which dependencies you use?

Best regards
@Anonymous(1) : Please try to download source code from "". saw there is some issue with SVN structure.

I will fixed it very soon(I have very limited internet access now)
@Anonymous(2) : You can't use Hibernate JPA, because Hibernate JPA support JPA 2.0 specification.

But Google App Engine only support JPA 1.0 specification. That why you got that "such method error".

For solve this issue used "Spring ORM Hibernate support"
@code-0men : I will commit my dependency also. But I didn't used Maven 2.

If you using Hibernate JPA support, Please look at my previous comment also.
@Lukas: Will try to develop another example project with JOOQ.
JAR file are added, Please get SVN update.
Nasir said…
From where I can download the source code of this sample application..
I've my final project developed in GAE so please help me out

All source code available in Google Project
Bill Comer said…
I can not suss out how to run this from within eclipse, using the GWT plugin. First off it says it is not a GWT app. If I convert as described here -

It sticks in all the appengine jars which I assume I do not need.

Please help.

If it's not a GWT based project, no need to follow GWT enable step. you can skip it.

Is it a Web Project or Maven project?
Unknown said…
This comment has been removed by the author.
Bill Comer said…
I was actually trying to load your CloudSQLSampl2 project.

So my mistake.
I did need to make two changes to your code base.

1) add the jar appengine-api-1.0-sdk-1.5.5.jar for the AppEngineDriver class
2) In appengine-web.xml, uncomment the line:

Thx for your post though. Great help.
Bill Comer said…
item '2' above referred to the threadsafe tag in appengineweb.xml

Popular posts from this blog

XSLT - Modify Date and DateTime value

Integrate With Mutual Certificate Authentication based Service

Yield Price Sri Lanka - Android Application