Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.SqlOutParameter


    replay();

    List<SqlParameter> parameters = new ArrayList<SqlParameter>();
    parameters.add(new SqlParameter("id", Types.NUMERIC));
    parameters.add(new SqlInOutParameter("name", Types.NUMERIC));
    parameters.add(new SqlOutParameter("customer_no", Types.NUMERIC));

    MapSqlParameterSource parameterSource = new MapSqlParameterSource();
    parameterSource.addValue("id", 1);
    parameterSource.addValue("name", "Sven");
    parameterSource.addValue("customer_no", "12345XYZ");
View Full Code Here


    replay();

    SimpleJdbcCall adder = new SimpleJdbcCall(mockDataSource).withProcedureName("add_invoice");
    adder.declareParameters(new SqlParameter("amount", Types.INTEGER),
        new SqlParameter("custid", Types.INTEGER),
        new SqlOutParameter("newid", Types.INTEGER));
    Number newId = adder.executeObject(Number.class, new MapSqlParameterSource()
        .addValue("amount", amount)
        .addValue("custid", custid));
    assertEquals(4, newId.intValue());
  }
View Full Code Here

    ctrlConnection.setReturnValue(mockCallable);

    replay();

    SimpleJdbcCall adder = new SimpleJdbcCall(mockDataSource).withFunctionName("add_invoice");
    adder.declareParameters(new SqlOutParameter("return", Types.INTEGER),
        new SqlParameter("amount", Types.INTEGER),
        new SqlParameter("custid", Types.INTEGER));
    Number newId = adder.executeFunction(Number.class, new MapSqlParameterSource()
        .addValue("amount", amount)
        .addValue("custid", custid));
View Full Code Here

    public StoredProcedureConfiguredViaJdbcTemplate(JdbcTemplate t) {
      setJdbcTemplate(t);
      setSql(SQL);
      declareParameter(new SqlParameter("intIn", Types.INTEGER));
      declareParameter(new SqlOutParameter("intOut", Types.INTEGER));
      compile();
    }
View Full Code Here

    public AddInvoice(DataSource ds) {
      setDataSource(ds);
      setSql(SQL);
      declareParameter(new SqlParameter("amount", Types.INTEGER));
      declareParameter(new SqlParameter("custid", Types.INTEGER));
      declareParameter(new SqlOutParameter("newid", Types.INTEGER));
      compile();
    }
View Full Code Here

    public AddInvoiceUsingObjectArray(DataSource ds) {
      setDataSource(ds);
      setSql(SQL);
      declareParameter(new SqlParameter("amount", Types.INTEGER));
      declareParameter(new SqlParameter("custid", Types.INTEGER));
      declareParameter(new SqlOutParameter("newid", Types.INTEGER));
      compile();
    }
View Full Code Here

    public ParameterMapperStoredProcedure(DataSource ds) {
      setDataSource(ds);
      setSql(SQL);
      declareParameter(new SqlParameter("in", Types.VARCHAR));
      declareParameter(new SqlOutParameter("out", Types.VARCHAR));
      compile();
    }
View Full Code Here

    public SqlTypeValueStoredProcedure(DataSource ds) {
      setDataSource(ds);
      setSql(SQL);
      declareParameter(new SqlParameter("in", Types.ARRAY, "NUMBERS"));
      declareParameter(new SqlOutParameter("out", Types.VARCHAR));
      compile();
    }
View Full Code Here

    public static final String SQL = "numeric_with_scale_sp";

    public NumericWithScaleStoredProcedure(DataSource ds) {
      setDataSource(ds);
      setSql(SQL);
      declareParameter(new SqlOutParameter("out", Types.DECIMAL, 4));
      compile();
    }
View Full Code Here

    return false;
  }

  @Override
  public SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta) {
    return new SqlOutParameter(parameterName, meta.getSqlType());
  }
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.SqlOutParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.