@Override public void startElement(Properties ctx, Element element) throws SAXException { String elementValue = element.getElementValue(); int AD_Backup_ID = -1; String Object_Status = null; log.info(elementValue); Attributes atts = element.attributes; String DBType = atts.getValue("DBType"); String sql = atts.getValue("statement").trim(); if (sql.endsWith(";")) sql = sql.substring(0, sql.length() - 1); PreparedStatement pstmt = DB.prepareStatement(sql, getTrxName(ctx)); try { if (DBType.equals("ALL")) { int n = pstmt.executeUpdate(); log.info("Executed SQL Statement: " + atts.getValue("statement")); } else if (DB.isOracle() == true && DBType.equals("Oracle")) { pstmt.executeUpdate(); log.info("Executed SQL Statement for Oracle: " + atts.getValue("statement")); } else if (DB.isPostgreSQL() && (DBType.equals("Postgres") || DBType.equals( "PostgreSQL") // backward compatibility with old packages developed by hand )) { // Avoid convert layer - command specific for postgresql // // pstmt = DB.prepareStatement(sql, null); // pstmt.executeUpdate(); // Connection m_con = DB.getConnectionRW(); try { Statement stmt = m_con.createStatement(); int n = stmt.executeUpdate(atts.getValue("statement")); log.info("Executed SQL Statement for PostgreSQL: " + atts.getValue("statement")); // Postgres needs to commit DDL statements if (m_con != null && !m_con.getAutoCommit()) m_con.commit(); stmt.close(); } finally { m_con.close(); } } pstmt.close(); } catch (Exception e) { log.log(Level.SEVERE, "SQLSatement", e); } }