文章来自于http://docs.google.com/Doc?id=dhg923vj_2ghr8q9f3#PHP
Overview
jiql is a JDBC wrapper for accessing Google DataStore on Google App Engine for JAVA.
jiql supports the use of standard SQL as a method for accessing
the DataStore
Architecture
jiql introduces a concept called "Table Leafs". Table Leafs
are DataStore Kinds that can be dynamically added or
chained together in infinite amounts to represent a Table.
Table Leafs provides a standard method, with SQL, to
retrieve entities of more than the "1000 limit" at a time.
For optimization, entities in the same Table Leaf, has
the same entity group parent. That means all of the
members in the Table Leaf, are located in the same
network node of the Google DataStore Cloud, for faster
access.
To disable Table Leaves, add the following at the end of the
CREATE TABLE statement:
tableleafs=false
Quickstart
Download
jiql.jar
java database engine and driver library and place under WEB-INF/lib/
NOTE: The appengine-api.jar must also be placed under WEB-INF/lib. This file comes
with the GAE SDK.
Follow the steps below to create a JDBC connection with jiql on
GAE-J in your JAVA code:
String url = "jdbc:jiql://local";
String password = "";
String user = "";
Properties props = new Properties();
props.put("user",user);
props.put("password",password);
Class clazz = Class.forName("org.jiql.jdbc.Driver");
Driver driver = (Driver) clazz.newInstance();
Connection Conn = driver.connect(url,props);
Below is the link to a GAE-Ready JDBC guestbook application:
After downloading jiql-jdbc-guestbook.war, unpack to your GAE Application directory.
Edit the ./WEB-INF/appengine-web.xml file and add your GAE Application ID.
Upload to Google App Engine for JAVA.
to start using the JDBC guestbook application.
The source code may also be downloaded at the following URL:
Remote Access
You can access Google DataStore from a remote client via the JiqlServlet.
This requires setting up the GAE-J Server as well as the Client Application configuration.
GAE-J Server Configuration
First configure the JiqlServlet in the web.xml like so:
<servlet>
<servlet-name>jiqlservlet</servlet-name>
<servlet-class>org.jiql.JiqlServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>jiqlservlet</servlet-name>
<url-pattern>/jiqlservlet</url-pattern>
</servlet-mapping>
Next add authenication information in the jiql.properties file:
File: ./WEB-INF/jiql.properties
Entries:
user=admin
password=jiql
Client Application Configuration
Follow the steps below to create a JDBC connection with jiql on the Client in your JAVA code:
String url = "jdbc:jiql:https://yourapp.appspot.com/jiqlservlet";
String user = "admin";
String password = "jiql";
//or
//String url = "jdbc:jiql:https://yourapp.appspot.com/jiqlservlet?user=admin&password=jiql";
Properties props = new Properties();
props.put("user",user);
props.put("password",password);
Class clazz = Class.forName("org.jiql.jdbc.Driver");
Driver driver = (Driver) clazz.newInstance();
Connection Conn = driver.connect(url,props);
Required Libraries for Remote Client
jiql.jar
appengine-api.jar
Apache Commons HTTPClient - you may download the bundled JAR
here
.
jiql has limited support for Transactions.
Transactions support is based on the Google DataStore Transaction
engine. Google DataStore does not support Global Transactions.
A Transaction is limited to Entities/Rows within a Group or Table/Kind.
This mean you are not able to perform operations on multiple
Tables/Kinds within the same Transaction. To enable Transactions,
set the enable.transactions
Connection property option to true.
NOTE: Transaction are NOT supported for Remote connections.
Limitations
FILTERS
For large data sets, the left most filter, should not return
a result set of more than about a couple thousand items.
A timeout may result. In this case you should try a narrower
filter. If the query is comprised of multiple filters, you may
place the filter that returns the least items, to the left of all
the other filters.
JOINS
When working with large data sets, JOINS should be combined with
at least 1 filter acting on a specific table. Otherwise, the query would
involve traversing the entirety of all the tables in the JOIN. Such
an operation is time consuming and may create a Google App Engine Timeout
if the operation exceeds 30 seconds.
Optional Properties
date.format
Specifies the Date Format of a DATETIME field.
e.g. date.format=yyyy/MM/dd
enable.transactions
Enable Transactions (please refer to the Transactions
topic)
e.g. enable.transactions=true
DatabaseProductVersion
Used to emulate other Databases, such as MySQL.
e.g. DatabaseProductVersion=4.0.0
DriverVersion
Used to emulate other Databases, such as MySQL.
e.g. DriverVersion=mysql-connector-java-5.0.4 ()
Catalog
Used to specify a Database Catalog.
e.g. Catalog=jiql
MetaCache
Used for Caching MetaData, such as DatabaseMetaData.
e.g. MetaCache=true
In addition to standard SQL functions, there are a number of jiql specific functions.
LOAD
LOAD DATA INTO TABLE table_name INTEXT column1,column2
1,'text1'
2,'text2'
tableleafs
specify whether to use Table Leafs or not (default true).
tableleafs
=false
prefix
specify whether to add a prefix to Tables created by jiql (default true)
prefix
=false
prefix_value
specify whether to add a customized prefix name to Tables created by jiql (default jiql)
prefix_value
=jiql
How to run PHP with your same MySQL queries
Running PHP on Google App Engine for JAVA requires jiql with a modified version of Quercus
,
a Java implementation of PHP 5. The following URL has the downloads:
After downloading jiql-quercus.war, unpack to your GAE Application directory.
Add your PHP files to the root of the unpacked Quercus application.
Edit the ./WEB-INF/appengine-web.xml file and add your GAE Application ID.
Upload to Google App Engine for JAVA.
Below is a simple PHP application from PLUS2NET as a starting PHP example:
分享到:
相关推荐
在这个"google_appengine_1.9.40.zip"压缩包中,包含的是 Google App Engine SDK 的一个特定版本,即1.9.40。这个SDK提供了开发、测试和在 Google 的基础设施上运行应用程序所需的所有工具和库。 首先,我们来深入...
这个分发版特别指出可以在Google App Engine(GAE)上运行,这为开发者提供了一个云平台来托管和运行MediaWiki实例。 MediaWiki的核心是用PHP编写的,这是一种广泛使用的服务器端脚本语言,特别适合快速开发动态...
Emlog for SAE 是一个基于PHP的个人博客系统,特别为新浪SAE(Sina App Engine)平台进行了优化和移植。这个系统允许用户在新浪SAE上快速搭建自己的博客,无需自行购买服务器或进行复杂的服务器配置,只需在新浪云...
随着Google App Engine的普及,更多人开始了解和采用其背后的设计思想,如Bigtable、Dynamo和PNUTS等,这些技术提供了更高效、可靠的可扩展性和容错性。App Engine模式下的存储服务不再仅仅是软件,而是变成了分布式...
**Google App Engine (GAE)** 是Google提供的一个云服务平台,允许开发者使用Java、Python、Go或PHP等语言构建和托管Web应用程序。GAE提供了自动扩展、负载均衡和数据存储等服务,无需担心服务器运维,开发者可以...
别忘了在生产环境中使用加密的 `.env` 文件,并配置相应的数据库连接信息。 **6. 监控和优化** 在 Google Cloud Console 中,你可以监控数据库的性能、规模和安全性。Laravel 提供的事件和日志系统也帮助你追踪...
【新浪云计算】是新浪公司提供的公共平台即服务(PaaS)云计算平台,名为Sina App Engine(SAE),它支持多种编程语言(如PHP、Java、Python),并提供MySQL数据库服务。开发者可以在这个平台上便捷地开发、托管和...
3. **存储服务**:由于使用了SAE,LFDServices可能涉及如何在新浪云数据库中存储爬取到的信息,如使用MySQL、MongoDB或其他SAE支持的存储服务。 4. **调度与并发控制**:LFDServices可能实现了爬虫任务的调度策略,...
Google App Engine是一个平台即服务(PaaS)产品,允许开发者在谷歌的基础设施上运行他们的Web应用。如果JJICKGAE_pro是基于GAE构建的,那么它可能会利用GAE提供的服务,如自动缩放、负载均衡、数据存储(例如使用...
- **简介**:Google App Engine 是由谷歌提供的服务,允许开发者在其基础设施上运行网络应用程序。 - **特色**: - **易于构建和维护**:应用程序可以轻松扩展以应对访问量和数据存储需求的增长。 - **自动负载...
10.1 Google App Engine 161 10.1.1 GAE Python SDK:安装、设置和起步 161 10.1.2 使用Python进行基本的GAE数据建模 165 10.1.3 查询与索引 168 10.1.4 过滤和结果排序 170 10.1.5 Java App Engine SDK 172 ...
SAE在市场竞争中,与Google AppEngine和Heroku等云服务提供商进行了对比,无论是在全球Alexa排名还是在企业用户数量上,SAE都表现出强劲的增长势头。其云商店和服务商店为开发者提供了丰富的应用模板和第三方服务,...
1. **云计算**:2008年,云计算开始崭露头角,AWS(亚马逊网络服务)和Google App Engine等平台提供了基础设施即服务(IaaS)和平台即服务(PaaS)的早期形态。系统分析师需要理解云计算的基本概念、工作原理,以及...
- **Google App Engine (GAE)**:谷歌提供的10GB免费空间,支持绑定自定义域名,可轻松安装博客程序等应用。 - **Heroku**:提供无限流量和容量的多语言支持空间,适用于各种应用场景。 #### 五、总结与建议 - **...
5. **Laravel部署到Azure**:在Azure上部署Laravel流程也类似,但可能使用App Service服务,这是一个PaaS(平台即服务)产品,专为Web应用设计: - 创建一个Web应用服务计划。 - 通过Git或FTP上传Laravel源代码。 ...
#### 四、SAE与Google App Engine对比 两者均为云应用平台,但SAE仅支持PHP语言。尽管如此,所有兼容PHP的程序经过适当定制后,均可在SAE环境下运行。这种定制化过程,虽然增加了初始设置的复杂度,但也确保了软件...
1. **嵌入式开发**:嵌入式系统是集成在设备或产品中的计算系统,负责特定的功能。学习嵌入式开发涉及硬件接口设计、操作系统、编程语言(如C/C++)、驱动程序开发和实时操作系统(RTOS)。 2. **PHP开发**:PHP是...
- **平台即服务 (PaaS)**:提供开发、测试和部署应用程序所需的环境和服务,例如Hadoop、Google App Engine和Facebook App等。 - **软件即服务 (SaaS)**:通过互联网提供软件应用的服务模式,用户无需安装即可使用,...
dbWebGen-PHP的数据库Web应用程序生成器 这个PHP应用程序会在关系数据库之上自动生成一个响应式Web应用程序。...在app文件夹中,创建一个PHP文件作为该应用程序的主要入口(通常为index.php )。 该文件非常简单:
- 新浪 SAE (Sina App Engine) 是一个基于云计算的应用平台,支持多种编程语言,如PHP、Python等。 - 它提供了一整套服务,包括但不限于应用托管、数据库服务、云存储等。 #### 三、Google文件系统 GFS - **特点**:...