private boolean addCols() { Connection conn = AggregatorDBUtil.getConnection(llocal); // System.out.println("DBURL:"+AggregatorDBUtil.getCurrentUrl()); String query = null; // resource_type" String scriptpath = scriptRevPath; // java.sql.Timestamp current = new // java.sql.Timestamp(" CURRENT_TIMESTAMP"); query = "Insert into monitoring_information_collector(name,connection_script_path," + "time_interval_in_ms, created_by, creation_date, collector_id)" + " values('test',+ '" + scriptpath + "','50000', 'hlrs test'," + "CURRENT_TIMESTAMP,'" + collectorId + "')"; try { Statement st = conn.createStatement(); st.executeUpdate(query); } catch (SQLException e) { logger.error("SQLException:" + e.getMessage() + ":" + e.getSQLState()); return false; } finally { try { conn.close(); } catch (Exception e) { return false; } ; } return true; }
private boolean deleteCols() { Connection conn = AggregatorDBUtil.getConnection(llocal); String query = null; // resource_type" query = "Delete FROM monitoring_information_collector where collector_id LIKE 'ColTest%'"; try { Statement st = conn.createStatement(); st.executeUpdate(query); } catch (SQLException e) { logger.error("SQLException:" + e.getMessage() + ":" + e.getSQLState()); return false; } finally { try { conn.close(); } catch (Exception e) { } ; } return true; }