File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Config.ini Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Config.ini" Watch "Config.ini" New topic


Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

May I know where can I find the config.ini file in the computer directories?

Because I want to write a program which can find all the details of databse and dsn details etc... using properties class.

So please tell me where can i find it.


Rahul Roy

and my programme is like this.
import java.util.*;
public class PropLoadTest
public static void main(String a[])


Properties prop= new Properties();
FileInputStream fis = new

//this is where i am getting the problems


String dbDsn = prop.getProperty("dsn");
String dbName = prop.getProperty("name");


} catch(Exception e)



Joel McNary

Joined: Aug 20, 2001
Posts: 1824

The config.ini file that you are referencing would have to be in the same directory as the directory from which you launched the java application. if it's not there, you will have to specify the path to where your config.ini is.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

Is this a file you authored or was created on the computer all ready? If you authored it then you can put it wherever you'd like depending on your needs. For example, if this was a network server and administrators needed a way to change this file remotely, you might place it on a shared drive and tell the server to search there.

Its up to you to decide where to place it to best fit the needs of your application. On the other hand if this is not a file you wrote, we'll need more specifics on what program created it.

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: Config.ini
It's not a secret anymore!