Hello everyone,
I have to code these lines in all by database related .java classes.
private String dbConString =
"jdbc:oracle:thin:@132.147.160.183:1521:abc";
private String username = "system";
private String password = "manager";
// Load the oracle jdbc driver
DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
DriverManager.setLogStream(System.out);
// Attempt to connect to a driver.
Connection con = DriverManager.getConnection
(dbConString, username, password);
Instead I did this in the login servlet's init method. Once the session
object for a client is created, I pass this con object and in the
respective database related classes i added these lines
public void getSession(Connection con)
{
this.con=con;
}
So from other servlets I get the session object. then I get
Connection con=(Connection)session.getValue("connection");
Then I call db.getSession(con);
But I get java.net.ConnectException: Connection refused . How to
overcome this?
Revathy R.
___________________________________________________________________________
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