private void releaseStatementParameters(SQLQuery sqlStatement) { if (!CommonUtils.isEmpty(sqlStatement.getParameters())) { for (SQLQueryParameter param : sqlStatement.getParameters()) { if (param.isResolved()) { param.getValueHandler().releaseValueObject(param.getValue()); } } } }
private Boolean prepareStatementParameters(SQLQuery sqlStatement) { // Bind parameters if (!CommonUtils.isEmpty(sqlStatement.getParameters())) { List<SQLQueryParameter> unresolvedParams = new ArrayList<>(); for (SQLQueryParameter param : sqlStatement.getParameters()) { if (!param.isResolved()) { unresolvedParams.add(param); } } if (!CommonUtils.isEmpty(unresolvedParams)) { // Resolve parameters if (!fillStatementParameters(unresolvedParams)) { return null; } } // Set values for all parameters return true; } return false; }
private void bindStatementParameters(DBCSession session, SQLQuery sqlStatement) throws DBCException { // Bind them for (SQLQueryParameter param : sqlStatement.getParameters()) { if (param.isResolved()) { // convert value to native form Object realValue = param.getValueHandler().getValueFromObject(session, param, param.getValue(), false); // bind param .getValueHandler() .bindValueObject(session, curStatement, param, param.getOrdinalPosition(), realValue); } } }