1 Reply Latest reply on Feb 27, 2004 7:55 AM by islamsakka

    Connectiion pool behavior.....

    brette esterbrookd Newbie

      Hey all,

      This forum is great! Lots of killer info. Thanks to all the gurus... I have aquick question regaurding the connection pooling in version 3.0.4...
      I have created a DB connection to MSSQL server 2k and I set the connection pool parameters in the service.xml as needed. My question is do I need to do anything special to use the pool? I am doing a JNDI look up on the DS. Can I assume that it is pooling....

      Here is my code....

      DataSource ds =
      (DataSource) new InitialContext().lookup("java:/MSSQLDS");
      Connection con = ds.getConnection();
      try {
      Statement stmt = con.createStatement();
      ResultSet rs = stmt.executeQuery("select * from TEST");
      while (rs.next()) {
      returnVal = (rs.getString("NAMe"));

      }
      } catch (Exception cnfe) {
      System.err.println("Unable to load MSSQL database driver!");
      System.err.println("ClassNotFoundException: " + cnfe.getMessage());
      } finally {
      con.close();
      }