简体   繁体   English

Google App引擎外部数据库

[英]Google App engine external database

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. 是否可以使用Google App Engine(GAE)中的java连接到远程数据库。 Whether it MySql, SQLServer, etc. Will it be allowed to make calls outside of it's domain? 是MySql,SQLServer等是否允许在其域外进行调用? Is it possible to even use the required libraries to make such a connection? 甚至可以使用所需的库来建立这样的连接吗?

The closest thing that you will find is the Google Secure Data Connector . 您会发现最接近的是Google安全数据连接器 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). 从GAE出站的所有连接都是基于HTTP的,因此您不太可能获得与数据库服务器(MySql,SqlServer等)的jdbc类型连接。

IMHO you can try to tunnel JDBC through HTTP. 恕我直言,您可以尝试通过HTTP隧道JDBC。 It is possible. 有可能的。 For example here is free solution http://sourceforge.net/projects/sqlgateway/ and here commercial http://www.idssoftware.com/jdbcdrv.html :) 例如,这里是免费的解决方案http://sourceforge.net/projects/sqlgateway/和这里的商业http://www.idssoftware.com/jdbcdrv.html :)

I do this all the time using a REST API on the server that contains the database. 我一直在包含数据库的服务器上使用REST API执行此操作。 Depending on your needs (eg, do you need ad-hoc queries) you may want to choose a REST API with some flexibility. 根据您的需要(例如,您是否需要临时查询),您可能希望选择具有一定灵活性的REST API。

There are quite a few simple REST-DB libraries around, such as http://phprestsql.sourceforge.net/ 有很多简单的REST-DB库,例如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 虽然您可能只想使用http://www.playframework.org/http://guides.rubyonrails.org/getting_started.html#rest轻松推出自己的产品

Dont use HTTP for DB connections as it is less secure. 不要使用HTTP进行数据库连接,因为它不太安全。

Use CLoud SQL instead (jdbc type connection, mysql like queries and drivers in jars) 使用CLoud SQL(jdbc类型连接,类似mysql的查询和驱动程序)

getting started with cloud sql 开始使用云sql

an easy video for java + cloud sql + app engine 一个简单的视频java +云sql + app引擎

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM