/** * Called after creating the first connection. The adapter should create its caches and do all initialization it requires. Most * importantly, the SQL query cache should be created. * * @param cnx * an open ready to use connection to the database. */ public void prepare(Properties p, Connection cnx) { this.tablePrefix = p.getProperty("com.enioka.jqm.jdbc.tablePrefix", ""); queries.putAll(DbImplBase.queries); for (Map.Entry<String, String> entry : DbImplBase.queries.entrySet()) { queries.put(entry.getKey(), this.adaptSql(entry.getValue())); } }
/** * Called after creating the first connection. The adapter should create its caches and do all initialization it requires. Most * importantly, the SQL query cache should be created. * * @param cnx * an open ready to use connection to the database. */ public void prepare(Properties p, Connection cnx) { this.tablePrefix = p.getProperty("com.enioka.jqm.jdbc.tablePrefix", ""); queries.putAll(DbImplBase.queries); for (Map.Entry<String, String> entry : DbImplBase.queries.entrySet()) { queries.put(entry.getKey(), this.adaptSql(entry.getValue())); } }
void runRawUpdate(String query_sql) { transac_open = true; Statement s = null; String sql = null; try { sql = parent.getAdapter().adaptSql(query_sql); if (sql.trim().isEmpty()) { return; } jqmlogger.debug(sql); s = _cnx.createStatement(); s.executeUpdate(sql); } catch (SQLException e) { throw new DatabaseException(sql, e); } finally { closeQuietly(s); } }
void runRawUpdate(String query_sql) { transac_open = true; Statement s = null; String sql = null; try { sql = parent.getAdapter().adaptSql(query_sql); if (sql.trim().isEmpty()) { return; } jqmlogger.debug(sql); s = _cnx.createStatement(); s.executeUpdate(sql); } catch (SQLException e) { throw new DatabaseException(sql, e); } finally { closeQuietly(s); } }
QueryPreparation q = new QueryPreparation(); q.parameters = new ArrayList<Object>(Arrays.asList(params)); q.sqlText = this.parent.getAdapter().adaptSql(rawQuery); this.parent.getAdapter().beforeUpdate(_cnx, q);
QueryPreparation q = new QueryPreparation(); q.parameters = new ArrayList<>(Arrays.asList(params)); q.sqlText = this.parent.getAdapter().adaptSql(rawQuery); this.parent.getAdapter().beforeUpdate(_cnx, q);