/** * Declare a parameter. Overridden method. * Parameters declared as {@code SqlParameter} and {@code SqlInOutParameter} * will always be used to provide input values. In addition to this any parameter declared * as {@code SqlOutParameter} where an non-null input value is provided will also be used * as an input paraneter. * <b>Note: Calls to declareParameter must be made in the same order as * they appear in the database's stored procedure parameter list.</b> * Names are purely used to help mapping. * @param param parameter object */ @Override public void declareParameter(SqlParameter param) throws InvalidDataAccessApiUsageException { if (param.getName() == null) { throw new InvalidDataAccessApiUsageException("Parameters to stored procedures must have names as well as types"); } super.declareParameter(param); }
if (isSqlReadyForUse()) { this.callString = resolveSql(); List<SqlParameter> parameters = getDeclaredParameters(); int parameterCount = 0; if (isFunction()) { callString.append("{? = call ").append(resolveSql()).append('('); parameterCount = -1; callString.append("{call ").append(resolveSql()).append('('); this.callableStatementFactory = new CallableStatementCreatorFactory(this.callString, getDeclaredParameters()); this.callableStatementFactory.setResultSetType(getResultSetType()); this.callableStatementFactory.setUpdatableResults(isUpdatableResults()); onCompileInternal();
/** * Create a new SqlCall object with SQL, but without parameters. * Must add parameters or settle with none. * @param ds the DataSource to obtain connections from * @param sql the SQL to execute */ public SqlCall(DataSource ds, String sql) { setDataSource(ds); setSql(sql); }
if (isSqlReadyForUse()) { this.callString = getSql(); List<SqlParameter> parameters = getDeclaredParameters(); int parameterCount = 0; if (isFunction()) { this.callString = "{? = call " + getSql() + "("; parameterCount = -1; this.callString = "{call " + getSql() + "("; logger.debug("Compiled stored procedure. Call string is [" + getCallString() + "]"); this.callableStatementFactory = new CallableStatementCreatorFactory(getCallString(), getDeclaredParameters()); this.callableStatementFactory.setResultSetType(getResultSetType()); this.callableStatementFactory.setUpdatableResults(isUpdatableResults()); this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor()); onCompileInternal();
if (isSqlReadyForUse()) { this.callString = resolveSql(); List<SqlParameter> parameters = getDeclaredParameters(); int parameterCount = 0; if (isFunction()) { callString.append("{? = call ").append(resolveSql()).append('('); parameterCount = -1; this.callableStatementFactory = new CallableStatementCreatorFactory(this.callString, getDeclaredParameters()); this.callableStatementFactory.setResultSetType(getResultSetType()); this.callableStatementFactory.setUpdatableResults(isUpdatableResults()); onCompileInternal();
/** * Create a new SqlCall object with SQL, but without parameters. * Must add parameters or settle with none. * @param ds DataSource to obtain connections from * @param sql SQL to execute */ public SqlCall(DataSource ds, String sql) { setDataSource(ds); setSql(sql); }
/** * Declare a parameter. Overridden method. * Parameters declared as {@code SqlParameter} and {@code SqlInOutParameter} * will always be used to provide input values. In addition to this any parameter declared * as {@code SqlOutParameter} where an non-null input value is provided will also be used * as an input paraneter. * <b>Note: Calls to declareParameter must be made in the same order as * they appear in the database's stored procedure parameter list.</b> * Names are purely used to help mapping. * @param param parameter object */ @Override public void declareParameter(SqlParameter param) throws InvalidDataAccessApiUsageException { if (param.getName() == null) { throw new InvalidDataAccessApiUsageException("Parameters to stored procedures must have names as well as types"); } super.declareParameter(param); }
/** * Create a new SqlCall object with SQL, but without parameters. * Must add parameters or settle with none. * @param ds the DataSource to obtain connections from * @param sql the SQL to execute */ public SqlCall(DataSource ds, String sql) { setDataSource(ds); setSql(sql); }
/** * Declare a parameter. Overridden method. * Parameters declared as {@code SqlParameter} and {@code SqlInOutParameter} * will always be used to provide input values. In addition to this any parameter declared * as {@code SqlOutParameter} where an non-null input value is provided will also be used * as an input paraneter. * <b>Note: Calls to declareParameter must be made in the same order as * they appear in the database's stored procedure parameter list.</b> * Names are purely used to help mapping. * @param param parameter object */ @Override public void declareParameter(SqlParameter param) throws InvalidDataAccessApiUsageException { if (param.getName() == null) { throw new InvalidDataAccessApiUsageException("Parameters to stored procedures must have names as well as types"); } super.declareParameter(param); }