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