简体   繁体   English

谷歌应用程序引擎:切换sql云数据库实例,保持源代码与java eclipse相同

[英]google app engine : switch sql cloud database instance , keeping the source code same java eclipse

The application is hosted in google app engine, we are using google cloud sql as database. 该应用程序托管在Google App Engine中,我们使用Google Cloud SQL作为数据库。

we are in testing phase of our application, so we have to database 我们处于应用程序的测试阶段,因此我们必须数据库

  1. live database 实时数据库
  2. test database. 测试数据库。

so can anyone please suggest a way to switch from live database to test database without changing the source code, for now we have created 2 different source code with different urls to connect to different database instances and have created 2 instance of application but we want to keep the source code same. 所以任何人都可以建议一种在不更改源代码的情况下从实时数据库切换到测试数据库的方法,因为现在我们已经创建了2个具有不同url的不同源代码以连接到不同的数据库实例,并创建了2个应用程序实例,但是我们想要保持源代码相同。

there are many ways to do this. 有很多方法可以做到这一点。 you could pass a url parameter to indicate which db to use. 您可以传递一个url参数来指示要使用的数据库。 you could also have an admin page where you select which db all will use. 您还可以在管理页面上选择所有要使用的数据库。

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

相关问题 在Eclipse中进行开发时无法从Google App Engine连接到Google Cloud SQL实例 - Unable to connect to Google Cloud SQL instance from Google App Engine when developing in Eclipse Google Cloud App Engine中的独立Java应用程序已连接到Google Cloud SQL数据库 - Standalone Java application in Google Cloud App Engine connecting to Google Cloud SQL database 如何在Eclipse for Google App Engine中从Java 7切换到Java 6? - How to switch from Java 7 to Java 6 in Eclipse for Google App Engine? 将Google App Engine Eclipse插件连接到Cloud SQL - Connect Google App Engine Eclipse Plugin to Cloud SQL 授权App Engine Java Servlet在Eclipse中使用Cloud SQL - Authorizing App Engine Java Servlet to use Cloud SQL in eclipse Google App Engine Java:“ CompiledCursor”的源代码在哪里? - Google App Engine Java: Where is the source code of “CompiledCursor”? Google Cloud App Engine - Eclipse 在 app.yaml 中显示“运行时:java 11”不是 Java - Google Cloud App Engine - Eclipse shows "runtime: java 11" in app.yaml is not Java Google Cloud SQL和Google App Engine - Google Cloud sql and Google app engine 适用于Java和Google云存储的Google App Engine - Google App Engine for Java and Google Cloud Storage 将Google App Engine应用程序(Java)导入Eclipse - Importing Google App Engine App (Java) to Eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM