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?
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.