Allow SQLStatements specific for postgres
This commit is contained in:
parent
1b17a6ad49
commit
4ef7cd2bc0
|
@ -2518,14 +2518,28 @@ public class PackInHandler extends DefaultHandler {
|
|||
String DBType = atts.getValue("DBType");
|
||||
PreparedStatement pstmt = DB.prepareStatement(atts.getValue("statement"), m_trxName);
|
||||
try {
|
||||
if(DBType.equals("ALL")){
|
||||
if(DBType.equals("ALL")) {
|
||||
int n = pstmt.executeUpdate();
|
||||
log.info("Executed SQL Statement: "+ atts.getValue("statement"));
|
||||
}
|
||||
else if(DB.isOracle() == true && DBType.equals("Oracle")){
|
||||
else if(DB.isOracle() == true && DBType.equals("Oracle")) {
|
||||
pstmt.executeUpdate();
|
||||
log.info("Executed SQL Statement for Oracle: "+ atts.getValue("statement"));
|
||||
}
|
||||
else if(DB.isPostgreSQL() == true && DBType.equals("PostgreSQL")){
|
||||
// Avoid convert layer - command specific for postgresql
|
||||
//
|
||||
// pstmt = DB.prepareStatement(sql, null);
|
||||
// pstmt.executeUpdate();
|
||||
//
|
||||
Connection m_con = DB.getConnectionRW(true);
|
||||
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();
|
||||
}
|
||||
/* else if(DB.isSybase() == true && DBType.equals("Sybase")){
|
||||
pstmt.executeUpdate();
|
||||
log.info("Exceuted SQL Statement for Sybase");
|
||||
|
|
Loading…
Reference in New Issue