Title: RE: Antwort: Learning Connection

thank you michael.

your code worked fine.

and i changed the DriverManager.getConnection("site:port:db", "id", "pw") to following:

               public static Connection getConnection() { 
                            Connection conn = null; 
                            try { 
                            DriverManager.registerDriver
                                (new oracle.jdbc.driver.OracleDriver()); 
                            conn = DriverManager.getConnection("jdbc:oracle:thin:@site:1521:web1", "id", "pw");
                            }

And it worked. I'm excited.
[EMAIL PROTECTED]

    -----Original Message-----
    From:   [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
    Sent:   Thursday, December 20, 2001 9:44 AM
    To:     [EMAIL PROTECTED]
    Cc:     Charles Williams
    Subject:        Antwort: Learning Connection


    Hi Charles,

    only for learning:

    in method connStatement use

    Statement stmnt = null;
    ResultSet rs = null;
    try
    {
      // work on stmnt and rs
    }
    catch(SQLException sqlExc)
    {
    }
    finally
    {
      try
      {
        if (rs != null)
        {
          rs.close();
        }
        if (stmnt != null)
        {
          stmnt.close();
        }
        if (conn != null)
        {
          conn.close();
        }
      }
     catch (SQLException sqlExc)
     {
       // do nothing
     }
    }


    and please can you send the original error message, your original jsp and
    the original code for better "debugging"?

    Thank you very much and have a nice day


    Michael

Reply via email to