Examples of SqlOutParameter


Examples of org.springframework.jdbc.core.SqlOutParameter

    if (this.metaDataProvider.isReturnResultSetSupported()) {
      return new SqlReturnResultSet(parameterName, rowMapper);
    }
    else {
      if (this.metaDataProvider.isRefCursorSupported()) {
        return new SqlOutParameter(parameterName, this.metaDataProvider.getRefCursorSqlType(), rowMapper);
      }
      else {
        throw new InvalidDataAccessApiUsageException("Return of a ResultSet from a stored procedure is not supported.");
      }
    }
View Full Code Here

Examples of org.springframework.jdbc.core.SqlOutParameter

  }

  @Override
  public SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta) {
    if (meta.getSqlType() == Types.OTHER && "refcursor".equals(meta.getTypeName())) {
      return new SqlOutParameter(parameterName, getRefCursorSqlType(), new ColumnMapRowMapper());
    }
    else {
      return super.createDefaultOutParameter(parameterName, meta);
    }
  }
View Full Code Here

Examples of org.springframework.jdbc.core.SqlOutParameter

  public void testValidateInOutParameter() {
    TestRdbmsOperation operation = new TestRdbmsOperation();
    operation.setDataSource(new DriverManagerDataSource());
    operation.setSql("DUMMY_PROC");
    operation.declareParameter(new SqlOutParameter("DUMMY_OUT_PARAM", Types.VARCHAR));
    operation.declareParameter(new SqlInOutParameter("DUMMY_IN_OUT_PARAM", Types.VARCHAR));
    operation.validateParameters(new Object[] {"DUMMY_VALUE1", "DUMMY_VALUE2"});
  }
View Full Code Here

Examples of org.springframework.jdbc.core.SqlOutParameter

    given(databaseMetaData.storesLowerCaseIdentifiers()).willReturn(true);

    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

Examples of org.springframework.jdbc.core.SqlOutParameter

    initializeAddInvoiceWithoutMetaData(false);
    SimpleJdbcCall adder = new SimpleJdbcCall(dataSource).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", 1103).
        addValue("custid", 3));
    assertEquals(4, newId.intValue());
View Full Code Here

Examples of org.springframework.jdbc.core.SqlOutParameter

    initializeAddInvoiceWithoutMetaData(false);
    SimpleJdbcCall adder = new SimpleJdbcCall(dataSource).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, 1103, 3);
    assertEquals(4, newId.intValue());
    verifyAddInvoiceWithoutMetaData(false);
    verify(connection, atLeastOnce()).close();
View Full Code Here

Examples of org.springframework.jdbc.core.SqlOutParameter

  @Test
  public void testAddInvoiceFuncWithoutMetaDataUsingMapParamSource() throws Exception {
    initializeAddInvoiceWithoutMetaData(true);
    SimpleJdbcCall adder = new SimpleJdbcCall(dataSource).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", 1103)
        .addValue("custid", 3));
View Full Code Here

Examples of org.springframework.jdbc.core.SqlOutParameter

  @Test
  public void testAddInvoiceFuncWithoutMetaDataUsingArrayParams() throws Exception {
    initializeAddInvoiceWithoutMetaData(true);
    SimpleJdbcCall adder = new SimpleJdbcCall(dataSource).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, 1103, 3);
    assertEquals(4, newId.intValue());
    verifyAddInvoiceWithoutMetaData(true);
View Full Code Here

Examples of org.springframework.jdbc.core.SqlOutParameter

  public boolean byPassReturnParameter(String parameterName) {
    return false;
  }

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

Examples of org.springframework.jdbc.core.SqlOutParameter

    if (this.metaDataProvider.isReturnResultSetSupported()) {
      return new SqlReturnResultSet(parameterName, rowMapper);
    }
    else {
      if (this.metaDataProvider.isRefCursorSupported()) {
        return new SqlOutParameter(parameterName, this.metaDataProvider.getRefCursorSqlType(), rowMapper);
      }
      else {
        throw new InvalidDataAccessApiUsageException("Return of a ResultSet from a stored procedure is not supported.");
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.