| Author |
need help regarding ip address used in establishing connection using jdbc
|
bagaria kushal
Greenhorn
Joined: Mar 29, 2011
Posts: 19
|
|
Hi all,
I have an application in which i establish connection with database using jdbc. My problem is that whenever the database server's ip address gets changed, i have to go into the code and change the ip address. Is there any solution so that i can mention the ip address outside the code like in xml or something?
|
 |
Rajkamal Pillai
Ranch Hand
Joined: Mar 02, 2005
Posts: 436
|
|
|
You can save the Db URI detail in either a .xml or .properties file and fetch it. That would make it more on the lines of 'configurable'. You will have to handle caching issues after modifying the value.
|
 |
Fatih Keles
Ranch Hand
Joined: Sep 01, 2005
Posts: 182
|
|
|
If it is a web application then you can use datasource managed by your application server.
|
 |
 |
|
|
subject: need help regarding ip address used in establishing connection using jdbc
|
|
|