Example #1
0
 private void releaseStatementParameters(SQLQuery sqlStatement) {
   if (!CommonUtils.isEmpty(sqlStatement.getParameters())) {
     for (SQLQueryParameter param : sqlStatement.getParameters()) {
       if (param.isResolved()) {
         param.getValueHandler().releaseValueObject(param.getValue());
       }
     }
   }
 }
Example #2
0
 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;
 }
Example #3
0
 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);
     }
   }
 }