problem to connect to database
| От | Melanie Bergeron | 
|---|---|
| Тема | problem to connect to database | 
| Дата | |
| Msg-id | 4006B673.6010700@globeecom.com обсуждение исходный текст  | 
		
| Ответы | 
                	
            		Re: problem to connect to database
            		
            		 Re: problem to connect to database Re: problem to connect to database  | 
		
| Список | pgsql-jdbc | 
Hi all!
I really need your help for this.  I installed the JDBC driver on my
machine by copying the jar file in C:\Program Files\Apache Software
Foundation\Tomcat 5.0\common\lib\pg73jdbc3.jar and set environment
variable CLASSPATH to this path.  I  create a JSP page (code below).
The first time I launched this JSP page, all was ok.  I don't use it
since last week but when I try to launched it yesterday, I got an error
to connecting database :
Error establishing the connection :
Something unusual has occured to cause the driver to fail.
Please report this exception: Exception: {0}
So, I don't think the error come from my code because it already work with the same code but I don't know what I do to
causethis error now.   
Any help will be greatly appreciated.
Melanie
-------code for jsp page---------
<%
  /* Load the JDBC Driver */
  try {
    Class.forName("org.postgresql.Driver");
  }catch(ClassNotFoundException cnfe) {
    out.println("<BR>Error loading driver " + cnfe + "<BR>");
  }
  /* Define the connection URL */
  String dbName = "gec_test";
  String host = "localhost";
  String postgresqlUrl = "jdbc:postgresql://" + host + "/" + dbName;
  /* Establish the connection */
  String username = "bergeron.melanie";
  String password = "*****";
  try{
    Connection connection = DriverManager.getConnection(postgresqlUrl,
username, password);
    ...
    }
    connection.close();
  }catch(SQLException e){
    out.println("<BR>Error establishing the connection : " + e + "<BR>");
  }
		
	В списке pgsql-jdbc по дате отправления: