private ResultSet getResultSet() throws Exception { conn = MBeanUtil.getConnection(conn); Statement stmt = conn.createStatement(); String sql = MBeanQueryObject.get().ValidationQuery.str(); ResultSet rs = stmt.executeQuery(sql); return rs; }
public String getCurrentStatus() throws Exception { try { getResultSet(); info = null; return STATUS_ALIVE; } catch (Throwable ex) { info = ex.getMessage(); return STATUS_DEAD; } finally { try { conn.close(); } catch (Exception ex) { // do nothing } } }