See java.util.Properties

Example:

    Properties my_properties = null;

    void Load_Properties(String properties_filename)
        throws MalformedURLException, IOException
    {
        my_properties = new Properties();

        my_properties.load(new URL(properties_filename).openStream());
    }

    String Get_Property(String property_name)
    {
        String return_val = "";

        if (my_properties != null) {
            return_val = (String) my_properties.get(property_name);
        }
        return return_val;
    }


The only extra bit is to get the properties filename into your servlet.
You could hard-code it ;-(  or pass it as a initialization parameter.
I call Load_Properties() as part of a singleton.

Hope this helps.


Bart Cassady
Database Analyst
Corporate Technology Services
Associated Engineering Group Ltd.
[EMAIL PROTECTED]

>>> soumya Govardhana <[EMAIL PROTECTED]> 04/13 7:32 AM >>>
Hi all,
 I'm working on Windows/NT with ServletExec. How to give database connection variables 
outside the servlet? and use them in servlet. Is there any why that  store these 
variables in an *.ini file and call them in servlet?

thank you,
soumya.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to