Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Config.ini

 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

REgards,

Rahul Roy


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


try{

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

FileInputStream("Config.ini");
//this is where i am getting the problems
prop.load(fis);

fis.close();

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

System.out.println(dbDsn);
System.out.println(dbName);

} catch(Exception e)
{
e.printStackTrace();

}

}

}
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4014
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic