FileDocCategorySizeDatePackage
CheckValidConnectionSQL.javaAPI DocJBoss 4.2.11998Fri Jul 13 21:01:14 BST 2007org.jboss.resource.adapter.jdbc

CheckValidConnectionSQL

public class CheckValidConnectionSQL extends Object implements Serializable, ValidConnectionChecker
Implements check valid connection sql
author
Adrian Brock
version
$Revision: 57189 $

Fields Summary
private static final long
serialVersionUID
String
sql
Constructors Summary
public CheckValidConnectionSQL()

   
    
   
   
public CheckValidConnectionSQL(String sql)

      this.sql = sql;
   
Methods Summary
public java.sql.SQLExceptionisValidConnection(java.sql.Connection c)

      try    
      {
         Statement s = c.createStatement();
         try
         {
            s.execute(sql);
            return null;
         }
         finally
         {
            s.close();
         }
      }
      catch (SQLException e)
      {
         return e;
      }