File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes how to create dsn at  runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "how to create dsn at  runtime" Watch "how to create dsn at  runtime" New topic

how to create dsn at runtime

sushant prabhu
Ranch Hand

Joined: Mar 22, 2001
Posts: 66
Tell me if this is possible. Instead of creating a dsn using control panel - system - odbc
. Is it possible to create a dsn from within my java program. i dont want to create a dsn before my java program runs but from within my program


Sushant Prabhu<br />SCJP2<br />SCWCD<br />OCA9i
Sachin Dere
Ranch Hand

Joined: Jan 14, 2003
Posts: 80
Hi Sushant,
wht u can do is make a properties file with ur driver name,user,pwd etc and load it through ur programe then to change the driver simple write that properties file and load it again to connect to a diff database.......
hope this helps,
kapil Gupta
Ranch Hand

Joined: Dec 17, 2001
Posts: 89
You can use Windows Scripting COM component that makes a DSN programatically that u can use in Java program using JNI or JavaCOM bridge
I agree. Here's the link:
subject: how to create dsn at runtime
It's not a secret anymore!