Hi,
You can creat a jsp file, and define the url, username, password
variables in it. In the JSP or other files need to connect to DB include it.
I think it is faster than reding files to get the string before connect to
DB.
For example:
1.db.jsp
<%!
String m_url = "jdbc:oracle:thin:@hostname:1521:servicename"
String m_username = "scott";
String m_password = "tiger";
%>
2.a.jsp includes db.jsp
<%@ page language="java" %>
<%@ include file="db.jsp"%>
xgh
----- Original Message -----
From: "Ritu Kama" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 28, 2000 3:19 PM
Subject: Can I read a text file thru a bean
> Hi all,
>
> My requirement is as follows:
>
> I have a initialization file containing the database name.
> Thru my bean I want to read the DB name and establish connection with that
> particular database. I don't want to hardcode the db name.
>
> Please suggest how to achieve this.
>
> Thanks
> Ritu
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets