• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

abt path, classpath, and system DSN

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..
I am Developing a java Desktop Application so i want to set automatically "path" , "clas path" and "System DSN for my database" instead of doing manully....please any one help me out...
and sorry if i posting this common question at wrong place(java in General)...
thank you..
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your PATH should be set as an environment variable. If you install a JRE on some computers (eg Windows) I think (but I am not at all sure) that is added to the PATH, or a program associated with the .jar files.
You can set the requisite CLASSPATH in a manifest file; it is somewhere in the Java Tutorials.
Don't know about DNS, I am afraid.
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For System DSNs you will probably go into the Windows registry. You can use Google to find out which registry keys you need.
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to set it in a batch file?
Regards.
 
kirtesh jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok...
can we use autoexec.bat file to store path and class path
if yes then can you tell how...
thank you..
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
off to the intermediate forum
 
Rob Spoor
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've searched and found the registry part that contains the DSN information:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI

There is one sub key for all DSNs there. You can then export that part to see what to write to the registry.

For user DSNs it's the same registry key but then in HKEY_CURRENT_USER.
 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody brief about how this can be done?
Whether we can set path, classpath in a bat file like this

I know these kind of setup can be very much useful , when we give an exe file to client(who doesnot know anything abt java or its installation)
But in this case, we need to send java jars also right.

Regards.
 
Ranch Hand
Posts: 326
Android Mac OS X Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. The PATH to the Java Runtime (JRE) bin catalogue should be set when installing it. At least it declares the system environment variable JAVA_HOME that can be used in your start script.

2. You should set the classpath for the application when you start the application and NOT in the system classpath. Use a launcher or a bat-file for this.

3. You should not use a system DNS (JDBC DBC type 1 DB driver) in your programs. Instead, you should take a look at DataSource and have a configuration file that holds the data on how to connect to the database and then have a declared DataSource that any part of your application that needs to access the database needs to access.
 
kirtesh jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for reply

Mr Prime,
can you tell me how can i find this key in the system Please...


HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI


and one more thing as mr. ramya narayanan suggested can be done like that...

Thank You
 
Rob Spoor
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the Windows Registry editor (also known as regedit.exe).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic