开发者

Using HSQLDB in Google-App-Engine

In my light web-app that will work on google-app-engine, I want to use HSQLDB.

While initiating the HSQLDB I'm using a url like that: "jdbc:hsqldb:file:./database/".

On l开发者_StackOverflow社区ocal tomcat everything goes well but on google-app-engine I'm getting the exception below;

Constructor threw exception; nested exception is com.hp.hpl.jena.sdb.SDBException: SQL Exception while connecting to database: jdbc:hsqldb:file:./database/appname : File input/output error ./database/appname.properties java.security.AccessControlException: access denied (java.io.FilePermission ./database write)

Does anyone can give a clue to define the proper url for running an HSQL db on google-app-engine?


I don't think GAE lets you write files in this level.

You may use an HSQLDB Memory Database which does not require a file but get erased when you app restarts.

Why don't you use JDO ?


In GAE you cannot write to a file, which obviously means HSQLDB won't work on GAE. As Mikhas suggested you can use an HSQLDB IN Memory,which won't be persisted anywhere. If you are using GAE, you have no option other than using JDO or JPA. For which Appengine has been optimised for. But in future we might get support for using relational databases inside app engine. But as if for now, the answer is NO.


The (also open source Java) H2 database might work. See project H2GAE (please not it is experimental). I didn't test this myself however.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜