mikeandbee
asked on
Changing a settings file in a Java program
Hi,
When I install a Java application, it requires a connection to a database. The flaw in this program is that it has a default database name (DSN) to which it tries to connect. Unless you happen to have that data source on your machine, it will fail. When installing this application, it never gives you the option to edit the DSN name. Can anyone suggest how I might change this? I am not a java programmer, so be gentle!. I suppose i need to change one of the source files for this.
thanks for any assistance
Mike
When I install a Java application, it requires a connection to a database. The flaw in this program is that it has a default database name (DSN) to which it tries to connect. Unless you happen to have that data source on your machine, it will fail. When installing this application, it never gives you the option to edit the DSN name. Can anyone suggest how I might change this? I am not a java programmer, so be gentle!. I suppose i need to change one of the source files for this.
thanks for any assistance
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I can change the DSN in the properties file AFTER it has been installed, but what I want is for the program to give me the option to add/find a DSN on my system, and not hardcode the DSN into the settings file. Is it possible tochange this with little knowledge of Java? Do i need a Java programming environment to do this (which i don't have)?
thanks
thanks
> Is it possible tochange this with little knowledge of Java?
Define little.
Sounds like this would require a code change.
> Do i need a Java programming environment
to do this (which i don't have)?
Yes.
Define little.
Sounds like this would require a code change.
> Do i need a Java programming environment
to do this (which i don't have)?
Yes.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: objects
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Venci75
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by: objects
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Venci75
EE Cleanup Volunteer
per recommendation
SpideyMod
Community Support Moderator @Experts Exchange
SpideyMod
Community Support Moderator @Experts Exchange
You'll have to change one of two things, depending on the application. It might be reading the DSN from a properties (settings) file, or it may be embedded in the application.
The easiest way to find the problem is to unpack the source files and use an editor that lets you search for the DSN string in multiple files. If you find it in a properties file, you won't have to recompile. If you find it in the source, you'll have to run "javac <file>" for the changed file.
Yuval