简体   繁体   中英

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.

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.

there are many ways to do this. you could pass a url parameter to indicate which db to use. you could also have an admin page where you select which db all will use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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