Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to create dsn at runtime

 
sushant prabhu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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

Bye
Sushant
 
Sachin Dere
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
Sachin
 
kapil Gupta
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Windows Scripting COM component that makes a DSN programatically that u can use in Java program using JNI or JavaCOM bridge
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic