简体   繁体   English

Google AppEngine / Java和现有数据库

[英]Google AppEngine/Java and existing DB

Is there a way to upload database contents to Google App Engine for Java, like the bulk uploader script in the Python version? 有没有办法将数据库内容上传到Google App Engine for Java,比如Python版本中的批量上传脚本? If not, how would you get existing data into your GAE/J app? 如果没有,您如何将现有数据导入GAE / J应用程序?

You can use the Python uploaders to upload data for your Java app. 您可以使用Python上传程序上传Java应用程序的数据。 First, create an app.yaml in an empty directory that contains the following: 首先,在包含以下内容的空目录中创建app.yaml:

application: yourappid
version: upload
runtime: python
api_version: 1
handlers:
    - url: /remote_api
      script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
      login: admin

Then, use 'appcfg.py update .' 然后,使用'appcfg.py update。' in that directory. 在那个目录中。 Now you can use the 'bulkloader.py' bulk load tool, pointing it at upload.latest.yourappid.appspot.com. 现在,您可以使用'bulkloader.py'批量加载工具,将其指向upload.latest.yourappid.appspot.com。 Since multiple major versions can run simultaneously, and all versions of an app share the same datastore, you can use the Python bulk uploader while still running your app in Java. 由于多个主要版本可以同时运行,并且应用程序的所有版本共享相同的数据存储区,因此您可以在使用Java运行应用程序时使用Python批量上传程序。

As far as I know, the only two options available are: 据我所知,现有的两个选项是:

  1. Bulkload.py Bulkload.py
  2. GAEBAR Gaebar的

As you have noted, both are python oriented. 如你所知,两者都是面向python的。 I have not seen a similar equivalent for GAE/J. 我还没有看到类似的GAE / J等价物。

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

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