public static long GrabMTBF(long x, String URL) { Connection con = null; try { con = Utility.getPerformanceDB_NONPOOLED_Connection(); PreparedStatement comm = con.prepareStatement("select mtbf from agg2 where uri=? and soapaction=? and timerange=?"); // comm.setString(1, ; comm.setString(1, URL); comm.setString(2, allitems); comm.setLong(3, x); ResultSet rs = comm.executeQuery(); long ret = 0; if (rs.next()) { ret = rs.getLong(1); } rs.close(); comm.close(); con.close(); return ret; } catch (Exception ex) { log.log(Level.ERROR, null, ex); } try { con.close(); } catch (Exception ex) { log.log(Level.WARN, SLACommon.getBundleString("ErrorClosingDB"), ex); } return 0; }
con = Utility.getPerformanceDBConnection(); } else { con = Utility.getPerformanceDB_NONPOOLED_Connection();
con = Utility.getPerformanceDBConnection(); } else { con = Utility.getPerformanceDB_NONPOOLED_Connection();
con = Utility.getPerformanceDBConnection(); } else { con = Utility.getPerformanceDB_NONPOOLED_Connection();
private String storeReport(byte[] bits, String jobId, boolean pooled) throws Exception { String id = UUID.randomUUID().toString(); Connection con = null; PreparedStatement cmd = null; if (pooled) { con = Utility.getPerformanceDBConnection(); } else { con = Utility.getPerformanceDB_NONPOOLED_Connection(); } try { cmd = con.prepareStatement("INSERT INTO arsreports(reportid, jobid, datetime,reportcontents) VALUES (?, ?, ?,?);"); cmd.setString(1, id); cmd.setString(2, jobId); cmd.setLong(3, System.currentTimeMillis()); cmd.setBytes(4, bits); cmd.execute(); } catch (Exception ex) { log.log(Level.ERROR, "error storing report", ex); DBUtils.safeClose(cmd); DBUtils.safeClose(con); throw ex; } finally { DBUtils.safeClose(cmd); DBUtils.safeClose(con); } return id; }
con = Utility.getPerformanceDBConnection(); } else { con = Utility.getPerformanceDB_NONPOOLED_Connection();
} else { ConfigCon = Utility.getConfigurationDB_NONPOOLED_Connection(); PerfCon = Utility.getPerformanceDB_NONPOOLED_Connection();
con = Utility.getPerformanceDBConnection(); } else { con = Utility.getPerformanceDB_NONPOOLED_Connection();
if (!pooled) { con = Utility.getConfigurationDB_NONPOOLED_Connection(); perf = Utility.getPerformanceDB_NONPOOLED_Connection(); } else { con = Utility.getConfigurationDBConnection();
perfcon = Utility.getPerformanceDB_NONPOOLED_Connection();
/** * provides a wrapper for getting alternate urls without passing a db * connection * * @param url * @param pooled * @return */ protected static List<String> GetAlternateUrls(String url, boolean pooled) { java.sql.Connection perf = null; if (pooled) { perf = Utility.getPerformanceDBConnection(); } else { perf = Utility.getPerformanceDB_NONPOOLED_Connection(); } List<String> ret = Collections.EMPTY_LIST; try { ret = GetAlternateUrls(url, perf); } catch (Exception ex) { log.log(Level.ERROR, null, ex); } finally { DBUtils.safeClose(perf); } return ret; } private boolean done = false;
} else { ConfigCon = Utility.getConfigurationDB_NONPOOLED_Connection(); PerfCon = Utility.getPerformanceDB_NONPOOLED_Connection();
/** * provides a wrapper for getting alternate urls without passing a db * connection * * @param url * @param pooled * @return */ static Set<String> GetAlternateUrls(String url, boolean pooled) { java.sql.Connection perf = null; if (pooled) { perf = Utility.getPerformanceDBConnection(); } else { perf = Utility.getPerformanceDB_NONPOOLED_Connection(); } Set<String> ret = Collections.EMPTY_SET; try { ret = GetAlternateUrls(url, perf); } catch (Exception ex) { log.log(Level.WARN, null, ex); } finally { DBUtils.safeClose(perf); } return ret; } }
} else { con = Utility.getConfigurationDB_NONPOOLED_Connection(); perf = Utility.getPerformanceDB_NONPOOLED_Connection();
p = Utility.getPerformanceDBConnection(); } else { p = Utility.getPerformanceDB_NONPOOLED_Connection();
perf = Utility.getPerformanceDBConnection(); } else { perf = Utility.getPerformanceDB_NONPOOLED_Connection();