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

MSSQLValidConnectionChecker

public class MSSQLValidConnectionChecker extends Object implements Serializable, org.jboss.resource.adapter.jdbc.ValidConnectionChecker
A MSSQLValidConnectionChecker.
author
Weston Price
version
$Revision: 57189 $

Fields Summary
private static final String
QUERY
private static final Logger
log
private static final long
serialVersionUID
The serialVersionUID
Constructors Summary
Methods Summary
public java.sql.SQLExceptionisValidConnection(java.sql.Connection c)


       
   
      SQLException sqe = null;
      Statement stmt = null;

      try
      {
         stmt = c.createStatement();
         stmt.execute(QUERY);
      }
     
      catch (SQLException e)
      {
         log.warn("warning: connection validation failed for current managed connection.");
         sqe = e;
      }
      finally
      {
         try
         {
            if(stmt != null)
            {
               stmt.close();
               
            }
         }
         catch (SQLException e)
         {
            log.warn("simple close failed for managed connection", e);
            
         }

      }
            
      return sqe;