FileDocCategorySizeDatePackage
PostgreSQLValidConnectionChecker.javaAPI DocJBoss 4.2.12258Fri Jul 13 21:01:14 BST 2007org.jboss.resource.adapter.jdbc.vendor

PostgreSQLValidConnectionChecker

public class PostgreSQLValidConnectionChecker extends Object implements Serializable, org.jboss.resource.adapter.jdbc.ValidConnectionChecker
Checks a PostgreSQL to see if it is alive. Uses an empty query.
author
Michael Barker
author
Weston Price

Fields Summary
private static final long
serialVersionUID
Constructors Summary
Methods Summary
public java.sql.SQLExceptionisValidConnection(java.sql.Connection cn)

see
org.jboss.resource.adapter.jdbc.ValidConnectionChecker#isValidConnection(java.sql.Connection)


         
      
   
      SQLException ex = null;
      Statement stmt = null;
      try
      {
         stmt = cn.createStatement();
         stmt.execute("");
      }
      catch (SQLException e)
      {
         ex = e;
      }
      finally
      {
         if (stmt != null)
         {
            try
            {
               stmt.close();
            }
            catch (Exception e)
            {
            }
         }
      }
      return ex;