Problem with DSN name!!! Urgent

I want to run my web application perfectly without compiling the code even though the DSN name change occurs at site. Is there any technique to do this.
[159 byte] By [java_fundooa] at [2007-11-26 18:38:33]
# 1
if you inject that data source jndi name with spring you can change it without recompiling code.do you mean jndi name changes or underlying connection changes? you can alter the connection pool parameters without having to change the jndi name.%
duffymoa at 2007-7-9 6:12:37 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Sorry im new to java,

i am using JSP ,and MS Access Database,

my code is as shown below

Connection conn=null;

Statement st=null;

ResultSet rs=null;

try

{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

}

catch (ClassNotFoundException e)

{

System.out.println("JdbcOdbc Bridge Driver not found");

}

try

{

conn = DriverManager.getConnection("jdbc:odbc:DBName","","");

String s="SELECT * from Table_Name '";

st = conn.createStatement();

rs=st.executeQuery(s);

while(rs.next())

{

ss=rs.getString(1);

}

I want to modify this code such that it should work at site even though ODBC DSN name chage occurs....

Thanks!

java_fundooa at 2007-7-9 6:12:37 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
> I want to modify this code such that it should work> at site even though ODBC DSN name chage occurs....So then don't hard-code it in your program. Pass it in as a parameter and build the JDBC URL string.
DrClapa at 2007-7-9 6:12:37 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
Can u please show me how to write...i mean any sampleThanks!
java_fundooa at 2007-7-9 6:12:37 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
Check out a beginning Java tutorial for how to pass parameters to methods. To construct the URL string:String url = "jdbc:odbc:" + dsn;conn = DriverManager.getConnection(url,"","");
DrClapa at 2007-7-9 6:12:37 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...