{@inheritDoc}

@see jp.co.future.uroborosql.context.SqlContext#getOutParams(java.sql.CallableStatement)
542740
@Override
	public Map<String, Object> getOutParams(final CallableStatement callableStatement) throws SQLException {
		Map<String, Object> out = new HashMap<>();
		Parameter[] bindParameters = getBindParameters();
		int parameterIndex = 1;
		for (Parameter parameter : bindParameters) {
			if (parameter instanceof OutParameter) {
				String key = parameter.getParameterName();
				out.put(key, getSqlFilterManager().doOutParameter(key, callableStatement.getObject(parameterIndex)));
			}
			parameterIndex++;
		}

		LOG.debug("Stored procedure out parameter[{}]", out);
		return out;
	}
1185445
private static String stmtAssignSqlParams(PreparedStatement stmt, List<SqlParam> sqlParams) throws SQLException {
		String cursorParam = null;
		if (sqlParams == null)
			return null;

		CallableStatement cstmt = null;
		if (stmt instanceof CallableStatement) {
			cstmt = (CallableStatement) stmt;
		}

		int pos = 0;
		for (SqlParam param : sqlParams) {
			pos++;
			boolean isPositionalParam = (param.code == null); // named vs positional param
			if (param.type == null)
				throw new SQLDataException("Please provide parameter type for param.code='" + param.code + "' pos=" + pos);
			if (isPositionalParam == false && cstmt == null)
				throw new SQLDataException("To use named params, need to use CallableStatement (param.code='" + param.code + "' pos=" + pos + ")");

			switch (param.type) {
				case CURSOR:
					if (cstmt == null)
						throw new SQLDataException("Param type CURSOR is not allowed for preparedStatement");
					cursorParam = param.code;
					if (param.code == null)
						cstmt.registerOutParameter(pos, JetJdbcParamType.CURSOR.oracleId);
					else
						cstmt.registerOutParameter(param.code, JetJdbcParamType.CURSOR.oracleId);
					break;
				case STRING:
					if (isPositionalParam)
						stmt.setString(pos, param.value == null ? null : param.value.toString());
					else
						cstmt.setString(param.code, param.value == null ? null : param.value.toString());
					break;
				case INTEGER: case LONG:
					if (param.value == null) {
						if (isPositionalParam)
							stmt.setNull(pos, Types.BIGINT);
						else
							cstmt.setNull(param.code, Types.BIGINT);
					} else {
						long val = 0;
						if (param.value.getClass().isAssignableFrom(Integer.class)) {
							val = (Integer) param.value;
						} else {
							val = (Long) param.value;
						}
						if (isPositionalParam)
							stmt.setLong(pos, val);
						else
							cstmt.setLong(param.code, val);
					}
					break;
				case TIMESTAMP:
					Date date1 = (Date) param.value;
					if (isPositionalParam)
						stmt.setTimestamp(pos, param.value == null ? null : new Timestamp(date1.getTime()));
					else
						cstmt.setTimestamp(param.code, param.value == null ? null : new Timestamp(date1.getTime()));
					break;
				case DATE:
					Date date2 = (Date) param.value;
					if (isPositionalParam)
						stmt.setDate(pos, param.value == null ? null : new java.sql.Date(date2.getTime()));
					else
						cstmt.setDate(param.code, param.value == null ? null : new java.sql.Date(date2.getTime()));
					break;
				case BLOB:
					if (param.value == null) {
						if (isPositionalParam)
							stmt.setBlob(pos, new ByteArrayInputStream(new byte[0]));
						else
							cstmt.setBlob(param.code, new ByteArrayInputStream(new byte[0]));
					} else {
						byte[] bytes = (byte[]) param.value;
						if (isPositionalParam)
							stmt.setBlob(pos, new ByteArrayInputStream(bytes), (int) bytes.length);
						else
							cstmt.setBlob(param.code, new ByteArrayInputStream(bytes), (int) bytes.length);
					}
					break;
				default:
					throw new IllegalStateException("Data type '" + param.type.toString() + "' is not supported yet");
			}
		}
		return cursorParam;
	}
177480
public PreparedStatementSetter getParameters() {
		if (list.size() == 0) {
			return null;
		}
		PreparedStatementSetter param = new PreparedStatementSetter() {
			@Override
			public void setValues(PreparedStatement pstmt) {
				try {
					StatementParameter.this.setValues(pstmt);
				}
				catch (SQLException e) {
					throw new InvalidParamDataAccessException(e);
				}
			}

		};
		return param;
	}
1061103
protected int setOutParameter(final CallableStatement callableStatement, int index) throws SQLException {
		callableStatement.registerOutParameter(index, sqlType.getVendorTypeNumber());
		parameterLog(index);
		index++;
		return index;
	}
375034
protected void getFieldMappings()
            throws SQLException {

        final String[] keys = getKeysFromResultSet();

        //
        // find fields or setters for return class
        //
        HashMap<String, AccessibleObject> mapFields = new HashMap<String, AccessibleObject>(_columnCount * 2);
        for (int i = 1; i <= _columnCount; i++) {
            mapFields.put(keys[i], null);
        }

        // public methods
        Method[] classMethods = _returnTypeClass.getMethods();
        for (Method m : classMethods) {

            if (isSetterMethod(m)) {
                final String fieldName = m.getName().substring(3).toUpperCase();
                if (mapFields.containsKey(fieldName)) {

                    // check for overloads
                    Object field = mapFields.get(fieldName);
                    if (field == null) {
                        mapFields.put(fieldName, m);
                    } else {
                        throw new ControlException("Unable to choose between overloaded methods " + m.getName()
                                                   + " on the " + _returnTypeClass.getName() + " class. Mapping is done using "
                                                   + "a case insensitive comparision of SQL ResultSet columns to field "
                                                   + "names and public setter methods on the return class.");
                    }
                }
            }
        }

        // fix for 8813: include inherited and non-public fields
        for (Class clazz = _returnTypeClass; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) {
            Field[] classFields = clazz.getDeclaredFields();
            for (Field f : classFields) {
                if (Modifier.isStatic(f.getModifiers())) continue;
                if (!Modifier.isPublic(f.getModifiers())) continue;
                String fieldName = f.getName().toUpperCase();
                if (!mapFields.containsKey(fieldName)) continue;

                Object field = mapFields.get(fieldName);
                if (field == null) {
                    mapFields.put(fieldName, f);
                }
            }
        }

        // finally actually init the fields array
        _fields = new AccessibleObject[_columnCount + 1];
        _fieldTypes = new int[_columnCount + 1];

        for (int i = 1; i < _fields.length; i++) {
            AccessibleObject f = mapFields.get(keys[i]);
            if (f == null) {
                throw new ControlException("Unable to map the SQL column " + keys[i]
                                           + " to a field on the " + _returnTypeClass.getName() +
                                           " class. Mapping is done using a case insensitive comparision of SQL ResultSet "
                                           + "columns to field names and public setter methods on the return class.");
            }

            _fields[i] = f;
            if (f instanceof Field) {
                _fieldTypes[i] = _tmf.getTypeId(((Field) f).getType());
            } else {
                _fieldTypes[i] = _tmf.getTypeId(((Method) f).getParameterTypes()[0]);
            }
        }
    }
658511
private String getParam(final SqlContext ctx, final String key) {
		Parameter param = ctx.getParam(key);
		if (param == null) {
			return null;
		} else {
			return String.valueOf(param.getValue());
		}
	}
393010
def _getParameters(self):
        """"""
        param = self.query._getParameters() 
        outputNames = []
        for outputCol in self.__columns:
            outputNames.append(outputCol)            
        param.update({'colModel' : '"'+', '.join(outputNames)+'"'})        
        return param
693933
public List<Map<String, Object>> executeForMapList(int sqlId, Map<String, ? extends Object> bindParams) {
      String sql = context.getResources().getString(sqlId);
      return executeForMapList(sql, bindParams);
   }
940212
CallableStatement getCallableStatement(final SqlContext sqlContext) throws SQLException {
		Connection conn = null;
		if (sqlContext.getDbAlias() != null) {
			conn = getConnection(sqlContext.getDbAlias());
		} else {
			conn = getConnection();
		}
		if (conn == null) {
			throw new IllegalArgumentException(sqlContext.getDbAlias());
		}

		CallableStatement stmt = sqlFilterManager.doCallableStatement(
				sqlContext,
				conn.prepareCall(sqlContext.getExecutableSql(), sqlContext.getResultSetType(),
						sqlContext.getResultSetConcurrency()));
		return stmt;
	}
950216
@Override
	public Set<String> getOutputOptions() {
		Set<String> result = new HashSet<String>();
		for (BlastOutputParameterEnum parameter : param.keySet()) {
			result.add(parameter.name());
		}
		return result;
	}
1254555
public static void setSqlParams(final SqlContext ctx, final String... paramsArray) {
		Set<String> bindParams = getSqlParams(ctx.getSql());

		for (String element : paramsArray) {
			String[] param = element.split("=");
			String key = param[0];
			if (bindParams.remove(key)) {
				// キーがバインドパラメータに存在するときは値を設定する
				if (param.length == 1) {
					// キーだけの指定は値をnullと扱う
					ctx.param(key, null);
				} else {
					String val = param[1];
					setParam(ctx, key, val);
				}
			}
		}

		// 指定がなかったキーについてはnullを設定する
		bindParams.forEach(s -> ctx.param(s, null));
	}
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.");
		}
	}
527184
@SuppressWarnings({ "unchecked", "rawtypes" })
	public <T> List<T> list(String sql, Object[] params, Class<T> clazz) {
		
		//call jdbcTemplate to query for result
		List<T> list = null;
		if (params == null || params.length == 0) {
			list = getProxy().query(sql, new BeanPropertyRowMapper(clazz));
		} else {
			list = getProxy().query(sql, params, new BeanPropertyRowMapper(clazz));
		}
		
		//return list
		return list;
	}
5818
public static Set<String> getSqlParams(final String sql) {
		SqlParser parser = new SqlParserImpl(sql);
		ContextTransformer transformer = parser.parse();
		Node rootNode = transformer.getRoot();

		Set<String> params = new LinkedHashSet<>();
		traverseNode(rootNode, params);
		params.removeIf(s -> CONSTANT_PAT.matcher(s).matches());
		return params;
	}
365451
function outputQuery(compiled, isParameter) {
    var sql = compiled.sql || '';
    if (sql) {
      if (compiled.method === 'select' && (isParameter || compiled.as)) {
        sql = '(' + sql + ')';
        if (compiled.as) {
          return this.alias(sql, this.wrap(compiled.as));
        }
      }
    }
    return sql;
  }
924395
@Override
	public SqlContext inOutParam(final String parameterName, final Object value, final SQLType sqlType) {
		if (value instanceof Optional) {
			Optional<?> optionalValue = (Optional<?>) value;
			if (optionalValue.isPresent()) {
				param(new InOutParameter(parameterName, optionalValue.get(), sqlType));
			} else {
				param(new InOutParameter(parameterName, null, JDBCType.NULL));
			}
			return this;
		} else {
			return param(new InOutParameter(parameterName, value, sqlType));
		}
	}
18217
String getPreparedStatementText(ControlBeanContext context, Method m, Object[] args) {
        StringBuilder sb = new StringBuilder();
        for (SqlFragment sf : _children) {
            sb.append(sf.getPreparedStatementText(context, m, args));
        }
        return sb.toString();
    }