• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

How to create DSN programmatically?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am working on some application where I need to use the DSN for JdbcOdbc connection which is created manually. Now I want to make this programmatically. How do I go about this?
Please help me.
Thanks in advance.
Vidyadhar.
------------------
 
Vidyadhar Hegde
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
Nobody is there to help me in creating the DSN programmatically
Looking for help.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Creating a dsn for odbc is a windows specific function. I don't think this is supported in java.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes its windows specific function but it would be some exe right, so if you find out the exe that creates the DSn then we have method called exec() in java.lang (refer the docs to find this method) to execute exe from a java program.
You also need to find out whether that exe accepts commandline parameters this you will be able to find if you execute the exe in dos mode..
Thats all you are ready to create dsn programatically.
Hope it makes some sense to you..
I tried to find the exe its rundll32.exe but I did not get any information on command line parameter. You need to find whether there is utility that runs in dos mode accepting parameters to create dsn..
Sorry about that
Please let me know.
[This message has been edited by narayan kulkarni (edited February 08, 2001).]
[This message has been edited by narayan kulkarni (edited February 08, 2001).]
 
Vidyadhar Hegde
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Kulkarni.
I'll try to find details about the rundll32.exe. Hope I'll get it.
 
Vidyadhar Hegde
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the Reply, Paul
If it is not supported by Java then, if you don't mind, can you tell me what is the solution for this problem.
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There already is a program set up to create ODBC connections in Windows.
I have a feeling that the program can not be run from the command line. If I recall, it has way too many parameters to be entered.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can us windows sdk to create a dll for the above functionality n then use dll through JNI calls...
try using SQLConfigDataSource() method of ODBC API ...
hope this solves ur problem ... if u found any other way do reply back...
Bye
 
money grubbing section goes here:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!