Configuring Database connection at runtime

Hi,

I am new to JDBC and urgently needs ur help.

What I want is to provide the URL (Connection String and DB info) in a config file and read that in the code. Also I should be able to change the DB location and connection string at runtime so that the next time the code executes, it takes the new connection string. I heard something about MBeans, can anyone help me in this.

Thanks in advance

Pankaj

PS: I might use JBoss or Tomcat.

[472 byte] By [bhomiapankaja] at [2007-11-27 7:02:06]
# 1
Well, then just don't hardode the URL, but supply it as a parameter? It looks fairly straightforward. Which problems are you occurring while developing?
BalusCa at 2007-7-12 18:53:04 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Thanks for the reply..Yes, but how to do it using MBean? Is Mbean the only solution available or there are some better approaches?regardsPankaj
bhomiapankaja at 2007-7-12 18:53:04 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...