java - database connection to different database in Spring -


i have 3 environments i.e. dev, test , prod. 3 databases

i want update data environment enviroment in particular table.

e.g. suppose want update table1 data in prod database, have select enviroment drop down , click "save" in dev or test.

to implement need new datasource object , need fire query update/insert data in perticular enviroment.

here have 2 ways it: 1. explicity fetch database.properties , configurations , create datasource , fire query using simple jdbc connection. 2. use spring framework, configure it's application context , there , run configured query.

my application in spring2 , database mapping, using ibatis.

i want know best way implement , tutorial can me in implementing it. searched got confused.

looks you: abstractroutingdatasource.

here discussion: how programatically change databases in spring 1 datasource?


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -