Google App engine external database

2019-02-22 03:18发布

I've been searching and can't find an answer anywhere. I also haven't had time to try it out either.

Is it possible, using java in the Google App Engine (GAE), to connect to a remote database. Whether it MySql, SQLServer, etc. Will it be allowed to make calls outside of it's domain? Is it possible to even use the required libraries to make such a connection?

4条回答
成全新的幸福
2楼-- · 2019-02-22 03:30

Dont use HTTP for DB connections as it is less secure.

Use CLoud SQL instead (jdbc type connection, mysql like queries and drivers in jars)

getting started with cloud sql

an easy video for java + cloud sql + app engine

查看更多
我想做一个坏孩纸
3楼-- · 2019-02-22 03:31

The closest thing that you will find is the Google Secure Data Connector. All connections outbound from GAE are HTTP based, so you're very unlikely to get a jdbc type connection to a database server (MySql, SqlServer, etc).

查看更多
forever°为你锁心
4楼-- · 2019-02-22 03:33

IMHO you can try to tunnel JDBC through HTTP. It is possible. For example here is free solution http://sourceforge.net/projects/sqlgateway/ and here commercial http://www.idssoftware.com/jdbcdrv.html :)

查看更多
趁早两清
5楼-- · 2019-02-22 03:36

I do this all the time using a REST API on the server that contains the database. Depending on your needs (eg, do you need ad-hoc queries) you may want to choose a REST API with some flexibility.

There are quite a few simple REST-DB libraries around, such as http://phprestsql.sourceforge.net/

Though you may want to simply roll your own using http://www.playframework.org/ or http://guides.rubyonrails.org/getting_started.html#rest

查看更多
登录 后发表回答