You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by SUPRIYA MISRA <su...@hotmail.com> on 2002/03/21 17:39:42 UTC

Property file

This is simple JSP/JDBC Connection issue -no struts

i want to make a JDBC Connection using a property file(plain text). No XML 
please.
Does anyone have a sample code.



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Property file

Posted by Arron Bates <ar...@pacific.net.au>.
Take a look in your Javadoc for standard edition, and look up 
java.util.Properties

Easient way to get a file from your classpath is to use the class 
object's getResourceAsStream method.
eg:
Properties p = new Properties();
p.load(this.getClass().getResourceAsStream(configFileName));

Then you just use the properties.
If you get stuck, there's a ton of this stuff in the forums of the 
JavaSoft site.

Arron.


SUPRIYA MISRA wrote:

> This is simple JSP/JDBC Connection issue -no struts
>
> i want to make a JDBC Connection using a property file(plain text). No 
> XML please.
> Does anyone have a sample code.
>
>
>
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>