Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.SqlParameter


    class CustomerQuery extends MappingSqlQuery {

      public CustomerQuery(DataSource ds) {
        super(ds, SELECT_ID_FORENAME_WHERE_ID_REUSED_2);
        setResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE);
        declareParameter(new SqlParameter("id1", Types.NUMERIC));
        compile();
      }
View Full Code Here


    class CustomerQuery extends MappingSqlQuery {

      public CustomerQuery(DataSource ds) {
        super(ds, SELECT_ID_FORENAME_WHERE_ID_REUSED_1);
        setResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE);
        declareParameter(new SqlParameter("id1", Types.NUMERIC));
        compile();
      }
View Full Code Here

    class CustomerUpdateQuery extends UpdatableSqlQuery {

      public CustomerUpdateQuery(DataSource ds) {
        super(ds, SELECT_ID_FORENAME_WHERE_ID);
        declareParameter(new SqlParameter(Types.NUMERIC));
        compile();
      }
View Full Code Here

      public NamedParameterUpdater() {
        setSql(UPDATE_NAMED_PARAMETERS);
        setDataSource(mockDataSource);
        if (namedDeclarations) {
          declareParameter(new SqlParameter("priceId", Types.DECIMAL));
          declareParameter(new SqlParameter("perfId", Types.NUMERIC));
        }
        else {
          declareParameter(new SqlParameter(Types.NUMERIC));
          declareParameter(new SqlParameter(Types.DECIMAL));
        }
        compile();
      }

      public int run(int performanceId, int type) {
View Full Code Here

      public NamedParameterUpdater() {
        setSql(UPDATE_NAMED_PARAMETERS);
        setDataSource(mockDataSource);
        if (namedDeclarations) {
          declareParameter(new SqlParameter("priceId", Types.DECIMAL));
          declareParameter(new SqlParameter("perfId", Types.NUMERIC));
        }
        else {
          declareParameter(new SqlParameter(Types.NUMERIC));
          declareParameter(new SqlParameter(Types.DECIMAL));
        }
        compile();
      }
View Full Code Here

    };
    query.setDataSource(mockDataSource);
    query.setSql(SELECT_ID_WHERE);
    query.declareParameter(
      new SqlParameter(COLUMN_NAMES[0], COLUMN_TYPES[0]));
    query.declareParameter(
      new SqlParameter(COLUMN_NAMES[1], COLUMN_TYPES[1]));
    query.compile();

    try {
      List list = query.execute();
      fail("Shouldn't succeed in running query without enough params");
View Full Code Here

      }
    };
    query.setDataSource(mockDataSource);
    query.setSql(SELECT_ID_WHERE);
    query.declareParameter(
      new SqlParameter(COLUMN_NAMES[0], COLUMN_TYPES[0]));
    query.declareParameter(
      new SqlParameter(COLUMN_NAMES[1], COLUMN_TYPES[1]));
    query.compile();

    try {
      Map params = new HashMap();
      params.put(COLUMN_NAMES[0], "Value");
View Full Code Here

    class CustomerQuery extends MappingSqlQuery {

      public CustomerQuery(DataSource ds) {
        super(ds, SELECT_ID_WHERE);
        declareParameter(new SqlParameter(Types.NUMERIC));
        declareParameter(new SqlParameter(Types.NUMERIC));
        compile();
      }

      protected Object mapRow(ResultSet rs, int rownum) throws SQLException {
        Customer cust = new Customer();
View Full Code Here

    class CustomerQuery extends MappingSqlQuery {

      public CustomerQuery(DataSource ds) {
        super(ds, SELECT_ID_FORENAME_WHERE);
        declareParameter(new SqlParameter(Types.VARCHAR));
        compile();
      }

      protected Object mapRow(ResultSet rs, int rownum) throws SQLException {
        Customer cust = new Customer();
View Full Code Here

    class CustomerQuery extends MappingSqlQuery {

      public CustomerQuery(DataSource ds) {
        super(ds, SELECT_ID_WHERE);
        declareParameter(
          new SqlParameter(COLUMN_NAMES[0], COLUMN_TYPES[0]));
        declareParameter(
          new SqlParameter(COLUMN_NAMES[1], COLUMN_TYPES[1]));
        compile();
      }

      protected Object mapRow(ResultSet rs, int rownum) throws SQLException {
        Customer cust = new Customer();
View Full Code Here

TOP

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

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.