call ODBC Data Source Administrator dialog from java code

Hai allIs it possible to call "ODBC Data Source Administrator dialog " using java code. Tell me whether it is possible or not?If yes then kindly give the code please.
[194 byte] By [Subrat.Ranjan.Raya] at [2007-11-26 20:11:12]
# 1
Anyone knows please tell me....It's urgent
Subrat.Ranjan.Raya at 2007-7-9 23:15:53 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

try{

Runtime.getRuntime().exec("odbcad32.exe");

} catch(Exception e){

e.printStackTrace();

}

or

try{

ProcessBuilder pb = new ProcessBuilder("odbcad32.exe");

pb.start();

}catch(IOException e){

ioe.printStackTrace();

}

make sure path variable has %SystemRoot%\system32; value.

guess both have to work... :)

NOTE: It is OS Dependent (specially for MS WINDOWS based OS's) & the second method would work for Jdk versions of 5.0 & above..

Hop this would be of some help :)

REGARDS,

RaHuL

RahulSharnaa at 2007-7-9 23:15:53 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
Hai Rahulthe code is working fine but now my requirement has changed and now i want to call ODBC dialog of some other machine. I tried with different different combinations of url but it is giving error. can u tell me the proper url ?
Subrat.Ranjan.Raya at 2007-7-9 23:15:53 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

> the code is working fine but now my requirement has

> changed and now i want to call ODBC dialog of some

> other machine. I tried with different different

> combinations of url but it is giving error. can u

> tell me the proper url ?

How would you do this outside of Java ? Once you know this then you have a chance of writing a Java wrapper to do the job.

P.S. If this is possible outside of Java then I see the potential for a large security hole.

sabre150a at 2007-7-9 23:15:53 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

yep i completely agree wid what sabre had said...

Accessing Odbc DS Administrator of a different machine which inside a network... is surely out of scope of Java or any language which focuses on security of System(N/W) resources.Even if you are successful in sharing your %SYSTEMROOT% folder of a X machine... to get a valid generate a valid URL the exe would be executed & the chages would be made to the currenty system on which the your Application is running.

However,it wud b gr8 if you can share your actual problem.Who knows we could certainly try out a workaround solution for it.

REGARDS,

RaHuL

RahulSharnaa at 2007-7-9 23:15:53 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...