/*
@see Platform#setNullForStatement(PreparedStatement, int, int)
763921
public void setNullForStatement(PreparedStatement ps, int index, int sqlType) throws SQLException
    {
        ps.setNull(index, sqlType);
    }
48912
public void setNull(String parameterName, int sqlType) {
        recordByName(parameterName, getDeclaredMethod(CallableStatement.class, "setNull", String.class, int.class), parameterName, sqlType);
    }
1356061
public void put(Short value) {
		if (value == null) {
			this.compiledStatement.bindNull(compiledStatementBindIndex++);
		} else {
			compiledStatement.bindLong(compiledStatementBindIndex++, (short) value);
		}
	}
219062
public void putNull(String key) {
		if (this.compiledStatement != null) {
			compiledStatement.bindNull(compiledStatementBindIndex++);
		} else if (values != null) {
			values.putNull(key);
			return;
		}

		names.add(key);
		// values.putNull(key);
		args.add(null);
		valueType.add(ParamType.NULL);
	}
406457
@Override
    public void setNString(int parameterIndex, String value) throws SQLException {
        internalStmt.setNString(parameterIndex, value);
    }
1099727
public static int queryForInt(Statement stmt, String sql, int nullvalue) {
    try {
      ResultSet rs = stmt.executeQuery(sql);
      try {
        if (!rs.next())
          return nullvalue;
        
        return rs.getInt(1);
      } finally {
        rs.close();
      }
    } catch (SQLException e) {
      throw new DukeException(e);
    }
  }
669698
public void setQueryParams(Collection queryParams, PreparedStatement ps) throws Exception {
		if ((queryParams == null) || (queryParams.size() == 0))
			return;
		int i = 1;
		Object key = null;

		Iterator iter = queryParams.iterator();
		while (iter.hasNext()) {
			key = iter.next();
			if (key != null) {
				convertType(i, key, ps);
				Debug.logVerbose("[JdonFramework] parameter " + i + " = " + key.toString(), module);
			} else {
				Debug.logWarning("[JdonFramework] parameter " + i + " is null", module);
				ps.setString(i, "");
			}
			i++;
		}

	}
1199777
public void setValues(PreparedStatement pstmt) throws SQLException {
		int i = 1;
		for (Class<?> type : this.type) {
			this.setValues(pstmt, i, type);
			i++;
		}
	}
1193923
private static <T> int setStatementParameters(final T item,
                                                 final Introspected introspected,
                                                 final FieldColumnInfo[] fcInfos,
                                                 final PreparedStatement stmt,
                                                 final int[] parameterTypes,
                                                 final Set<String> excludedColumns) throws SQLException
   {
      int parameterIndex = 1;
      for (final FieldColumnInfo fcInfo : fcInfos) {
         if (excludedColumns == null || !isIgnoredColumn(excludedColumns, fcInfo.getColumnName())) {
            final int parameterType = parameterTypes[parameterIndex - 1];
            final Object object = mapSqlType(introspected.get(item, fcInfo), parameterType);
            if (object != null && !fcInfo.isSelfJoinField()) {
               stmt.setObject(parameterIndex, object, parameterType);
            }
            else {
               stmt.setNull(parameterIndex, parameterType);
            }
            ++parameterIndex;
         }
      }
      return parameterIndex;
   }
234856
public static void setArguments(PreparedStatement statement,
			Object[] selectionArgs) throws SQLException {
		if (selectionArgs != null) {
			for (int i = 0; i < selectionArgs.length; i++) {
				statement.setObject(i + 1, selectionArgs[i]);
			}
		}
	}
387162
public void setIntIfNotNull(@NotNull final String key, @Nullable final Integer value) {
        if (null != value) {
            setInt(key, value);
        }
    }
556354
public final void ifStatement() throws RecognitionException {
		int ifStatement_StartIndex = input.index();

		Token s=null;
		Token y=null;
		ParserRuleReturnScope x =null;
		ParserRuleReturnScope z =null;


		         JavaIfBlockDescr id = null;
		         JavaElseBlockDescr ed = null;         
		    
		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 85) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:771:5: (s= 'if' parExpression x= statement (y= 'else' ( 'if' parExpression )? z= statement )* )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:773:5: s= 'if' parExpression x= statement (y= 'else' ( 'if' parExpression )? z= statement )*
			{
			s=(Token)match(input,87,FOLLOW_87_in_ifStatement3243); if (state.failed) return;
			pushFollow(FOLLOW_parExpression_in_ifStatement3245);
			parExpression();
			state._fsp--;
			if (state.failed) return;
			if ( state.backtracking==0 ) {
			        increaseLevel();
			        id = new JavaIfBlockDescr();
			        id.setStart( ((CommonToken)s).getStartIndex() );  pushContainerBlockDescr(id, true); 
			    }
			pushFollow(FOLLOW_statement_in_ifStatement3263);
			x=statement();
			state._fsp--;
			if (state.failed) return;
			if ( state.backtracking==0 ) {
			        decreaseLevel();
			        id.setTextStart(((CommonToken)(x!=null?(x.start):null)).getStartIndex() );
			        id.setEnd(((CommonToken)(x!=null?(x.stop):null)).getStopIndex() ); popContainerBlockDescr(); 
			    }
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:786:5: (y= 'else' ( 'if' parExpression )? z= statement )*
			loop113:
			while (true) {
				int alt113=2;
				alt113 = dfa113.predict(input);
				switch (alt113) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:787:6: y= 'else' ( 'if' parExpression )? z= statement
					{
					y=(Token)match(input,78,FOLLOW_78_in_ifStatement3290); if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:787:16: ( 'if' parExpression )?
					int alt112=2;
					int LA112_0 = input.LA(1);
					if ( (LA112_0==87) ) {
						int LA112_1 = input.LA(2);
						if ( (LA112_1==36) ) {
							int LA112_43 = input.LA(3);
							if ( (synpred171_Java()) ) {
								alt112=1;
							}
						}
					}
					switch (alt112) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:787:17: 'if' parExpression
							{
							match(input,87,FOLLOW_87_in_ifStatement3294); if (state.failed) return;
							pushFollow(FOLLOW_parExpression_in_ifStatement3296);
							parExpression();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					if ( state.backtracking==0 ) {
					        increaseLevel();
					        ed = new JavaElseBlockDescr();
					        ed.setStart( ((CommonToken)y).getStartIndex() );  pushContainerBlockDescr(ed, true); 
					    }
					pushFollow(FOLLOW_statement_in_ifStatement3327);
					z=statement();
					state._fsp--;
					if (state.failed) return;
					if ( state.backtracking==0 ) {
					        decreaseLevel();
					        ed.setTextStart(((CommonToken)(z!=null?(z.start):null)).getStartIndex() );
					        ed.setEnd(((CommonToken)(z!=null?(z.stop):null)).getStopIndex() ); popContainerBlockDescr();               
					    }
					}
					break;

				default :
					break loop113;
				}
			}

			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 85, ifStatement_StartIndex); }

		}
	}
126879
public void setInt(Integer value) {
		this.checkNull(value);
		list.add(value);
		type.add(Integer.class);
	}
850171
private String ifNull(int rowIndex){

        if(params.length != 2){
            throw new IllegalArgumentException("Wrong number of Parameters for if null expression");
        }

        final RecordList.Record currentRecord = recordList.getRecords().get(rowIndex);
        final String field1 = currentRecord.getValueByFieldName(params[0]);

        if (!field1.isEmpty()){
            return field1;
        }
        final String field2 = currentRecord.getValueByFieldName(params[1]);
        return field2;
    }
1048743
@Override
    public void psSetBytes(PreparedStatement pstmtImpl, int i, byte[] x) throws SQLException {
        int length = (x == null ? 0 : x.length);
        if (tc.isDebugEnabled())
            Tr.debug(this, tc, "psSetBytes: " + length);

        if ((x != null) && (length > 2000)) {
            if (tc.isDebugEnabled())
                Tr.debug(this, tc, "ORACLE setBytes byte array length > 2000 workaround.");
            pstmtImpl.setBinaryStream(i, new ByteArrayInputStream(x), length);
        } else
            pstmtImpl.setBytes(i, x);
    }
285552
public void put(Boolean value) {
		if (value == null) {
			this.compiledStatement.bindNull(compiledStatementBindIndex++);
		} else {
			this.compiledStatement.bindLong(compiledStatementBindIndex++, (value == true ? 1 : 0));
		}
	}
863646
public void setNull(String parameterName, int sqlType) throws SQLException {
		checkClosed();
		try {
			this.internalCallableStatement.setNull(parameterName, sqlType);
			if (this.logStatementsEnabled){
				this.logParams.put(parameterName, PoolUtil.safePrint("[SQL NULL type ", sqlType, "]"));
			}
		} catch (SQLException e) {
			throw this.connectionHandle.markPossiblyBroken(e);
			
		}
	}