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

43 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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.