File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "properties file" Watch "properties file" New topic
Author

properties file

chandra t
Greenhorn

Joined: Aug 08, 2001
Posts: 3
hi
i am writing a servlet which access a database using properties file.the error is it is not able to find the properties file.
so could u please tell me where should i keep the properties file
iam using jbuilder.
when i gave completepath like c:\..\...it is giving error null pointer exception.
Robert Brunner
Ranch Hand

Joined: Jul 18, 2001
Posts: 49
Originally posted by chandra t:
hi
i am writing a servlet which access a database using properties file.the error is it is not able to find the properties file.
so could u please tell me where should i keep the properties file
iam using jbuilder.
when i gave completepath like c:\..\...it is giving error null pointer exception.


Why don't you set the property inside the Servlet (using the System.setProperty method)? A better technique is to use a datasource.
As far as the specifics, I am afraid they are a bit servlet specific. You might try putting the properties file in the same directory as the servlet class file, but then this might pose a security risk.
chandra t
Greenhorn

Joined: Aug 08, 2001
Posts: 3
thank u robert.
i got that.we can place property file any where and we can give the complete path.
and if we want to put the property file anywhere we have to set the path in classpath and can access the prperty file using System.getProperty
cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: properties file