Sets parameters to the PreparedStatement.

@param stmt the prepared statement
@param propDescs the property descriptors
@param entity the entity

@throws SQLException if something goes wrong
162210
@SuppressWarnings("unchecked")
    protected void setParameters(PreparedStatement stmt, PropertyDesc[] propDescs, Object entity) throws SQLException {
        for (int i = 0; i < propDescs.length; i++) {
            PropertyDesc propertyDesc = propDescs[i];
            if(propertyDesc == null /*|| propertyDesc.getValue(entity) == null*/){
                stmt.setObject(i + 1, null);
            } else {
                Class<?> propertType = propertyDesc.getPropertyType();
                @SuppressWarnings("rawtypes")
                ValueType valueType = MirageUtil.getValueType(propertType, propertyDesc, dialect, valueTypes);
                if(valueType != null){
                    valueType.set(propertType, stmt, propertyDesc.getValue(entity), i + 1);
                } else {
                    if(logger.isWarnEnabled()) {
                        logger.warn("valueType for " + propertType.getName() + " not found.");
                    }
                }
            }
        }
    }
21944
public static PreparedStatement prepareStatement(Connection conn, SqlBuilder sqlBuilder) throws SQLException {
		return prepareStatement(conn, sqlBuilder.build(), sqlBuilder.getParamValueArray());
	}
88737
@Override
	public int setParameter(final PreparedStatement preparedStatement, final int index,
			final BindParameterMapperManager parameterMapperManager) throws SQLException {
		return setStreamParameter(preparedStatement, index, parameterMapperManager);
	}
1309086
private int bindStatement(PreparedStatement stmt, int index, ExistsCriteria crit, ClassDescriptor cld) throws SQLException
    {
        Query subQuery = (Query) crit.getValue();

        // if query has criteria, bind them
        if (subQuery.getCriteria() != null && !subQuery.getCriteria().isEmpty())
        {
            return bindStatement(stmt, subQuery.getCriteria(), cld.getRepository().getDescriptorFor(subQuery.getSearchClass()), index);

            // otherwise, just ignore it
        }
        else
        {
            return index;
        }
    }
633268
public static PreparedStatement setInts(int index, PreparedStatement stmt, int... params)
			throws SQLException {
		return set(index, stmt, params, null, null);
	}
615425
public void psSetString(PreparedStatement pstmtImpl, int i, String x) throws SQLException {
        pstmtImpl.setString(i, x);
    }
1187489
protected void setSqlSource(MappedStatement ms, SqlSource sqlSource) {
        MetaObject msObject = MetaObjectUtil.forObject(ms);
        msObject.setValue("sqlSource", sqlSource);
    }
985626
@Override
	public void bindParams(final PreparedStatement preparedStatement) throws SQLException {
		Parameter[] bindParameters = getBindParameters();

		Set<String> matchParams = new HashSet<>();
		int parameterIndex = 1;
		for (Parameter bindParameter : bindParameters) {
			Parameter parameter = getSqlFilterManager().doParameter(bindParameter);
			parameterIndex = parameter.setParameter(preparedStatement, parameterIndex, parameterMapperManager);
			matchParams.add(parameter.getParameterName());
		}
		// SQL上のバインドパラメータ群（bindNames）に対応する値がすべて設定されているかどうかをチェックする
		if (!matchParams.containsAll(bindNames)) {
			Set<String> missMatchParams = new LinkedHashSet<>(bindNames);
			missMatchParams.removeAll(matchParams);
			throw new ParameterNotFoundRuntimeException("Parameter " + missMatchParams.toString() + " is not bound.");
		}
	}
1209756
static void setParameters(PreparedStatement ps, List<Parameter> params, boolean namesAllowed)
            throws SQLException {
        for (int i = 1; i <= params.size(); i++) {
            if (params.get(i - 1).hasName() && !namesAllowed)
                throw new SQLException("named parameter found but sql does not contain names");
            Object o = params.get(i - 1).value();
            try {
                if (o == null)
                    ps.setObject(i, null);
                else if (o == Database.NULL_CLOB)
                    ps.setNull(i, Types.CLOB);
                else if (o == Database.NULL_BLOB)
                    ps.setNull(i, Types.BLOB);
                else {
                    Class<?> cls = o.getClass();
                    if (Clob.class.isAssignableFrom(cls)) {
                        setClob(ps, i, o, cls);
                    } else if (Blob.class.isAssignableFrom(cls)) {
                        setBlob(ps, i, o, cls);
                    } else if (Calendar.class.isAssignableFrom(cls)) {
                        Calendar cal = (Calendar) o;
                        Timestamp t = new java.sql.Timestamp(cal.getTimeInMillis());
                        ps.setTimestamp(i, t, cal);
                    } else if (Time.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        ps.setTime(i, (Time) o, cal);
                    } else if (Timestamp.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        ps.setTimestamp(i, (Timestamp) o, cal);
                    } else if (java.sql.Date.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        ps.setDate(i, (java.sql.Date) o, cal);
                    } else if (java.util.Date.class.isAssignableFrom(cls)) {
                        Calendar cal = Calendar.getInstance();
                        java.util.Date date = (java.util.Date) o;
                        ps.setTimestamp(i, new java.sql.Timestamp(date.getTime()), cal);
                    } else
                        ps.setObject(i, o);
                }
            } catch (SQLException e) {
                log.debug("{} when setting ps.setObject({},{})", e.getMessage(), i, o);
                throw e;
            }
        }
    }
792317
@Override
	public int setParameter(final PreparedStatement preparedStatement, final int index,
			final BindParameterMapperManager parameterMapperManager) throws SQLException {
		return setOutParameter((CallableStatement) preparedStatement, index);
	}
51371
public static PreparedStatement setLongs(int index, PreparedStatement stmt, long... params)
			throws SQLException {
		return set(index, stmt, null, params, null);
	}
39325
public void execute(String query, Object... params) throws SQLException {
        createPreparedStatement(query, 0, params).execute();
    }
1030245
public int bindStatement(PreparedStatement stmt, Query query, ClassDescriptor cld, int param) throws SQLException
    {
        int result;

        result = bindStatement(stmt, query.getCriteria(), cld, param);
        result = bindStatement(stmt, query.getHavingCriteria(), cld, result);

        return result;
    }
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]);
			}
		}
	}
1328455
private int bindStatement(PreparedStatement stmt, int index, BetweenCriteria crit, ClassDescriptor cld) throws SQLException
    {
        index = bindStatementValue(stmt, index, crit.getAttribute(), crit.getValue(), cld);

        return bindStatementValue(stmt, index, crit.getAttribute(), crit.getValue2(), cld);
    }
94809
protected void setParameter( PreparedStatement pPreparedStatement ) throws SQLException
  {
    if( _parameters != null )
    {
      for( int i = 0; i < _parameters.size(); i++ )
      {
        pPreparedStatement.setObject( i + 1, _parameters.get( i ) );
      }
    }
  }
1168442
private void setParameterObject(final PreparedStatement preparedStatement, final int parameterIndex,
			final Object param, final BindParameterMapperManager parameterMapperManager) throws SQLException {
		//JDBCの受け付ける型に変換
		Object jdbcParam = parameterMapperManager.toJdbc(param, preparedStatement.getConnection());
		if (Objects.equals(sqlType, SQL_TYPE_NOT_SET)) {
			if (jdbcParam instanceof java.sql.Array) {
				preparedStatement.setArray(parameterIndex, (java.sql.Array) jdbcParam);
			} else {
				preparedStatement.setObject(parameterIndex, jdbcParam);
			}
		} else {
			int targetSqlType = sqlType.getVendorTypeNumber();//各JDBCの対応状況が怪しいのでintで扱う
			if (jdbcParam != null) {
				if (jdbcParam instanceof java.sql.Array) {
					preparedStatement.setArray(parameterIndex, (java.sql.Array) jdbcParam);
				} else {
					preparedStatement.setObject(parameterIndex, jdbcParam, targetSqlType);
				}
			} else {
				preparedStatement.setNull(parameterIndex, targetSqlType);
			}
		}
	}