Examples of SqlParameterSource


Examples of net.hasor.db.jdbc.SqlParameterSource

        //            String sqlText = ParsedSql.buildSql(this.parsedSql, paramSource);
        //            return sqlText;
        //        }
        @Override
        public void setValues(final PreparedStatement ps, final int index) throws SQLException {
            SqlParameterSource paramSource = this.batchArgs[index];
            //1.确定参数对象
            Object[] sqlValue = ParsedSql.buildSqlValues(this.parsedSql, paramSource);
            //2.设置参数
            int sqlColIndx = 1;
            for (Object element : sqlValue)
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

    int arg1 = 24;
    String arg2 = "foo";

    MockControl mc = MockControl.createControl(NamedParameterJdbcOperations.class);
    NamedParameterJdbcOperations npjo = (NamedParameterJdbcOperations) mc.getMock();
    SqlParameterSource args = new MapSqlParameterSource().addValue("id", arg1).addValue("xy", arg2);
    npjo.queryForInt(sql, args);
    mc.setDefaultMatcher(new ArrayMatcher());
    mc.setReturnValue(expectedResult);
    mc.replay();
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

   * @see
   * com.odb.core.dao.ODBDAO#getDataSourceByDataSourceID(java.lang.String)
   */
  public DataSourceInfo getDataSourceByDataSourceID(String dsID) throws SQLException {
    String sql = "SELECT * FROM ODB_DATASOURCE_INFO WHERE DATASOURCE_ID=:dataSourceID";
    SqlParameterSource param = new MapSqlParameterSource("dataSourceID", dsID);
    return jdbcTemp.query(sql, param, new DataSourceInfoResultSetExtractor());
  }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

   *
   * @see com.odb.core.dao.ODBDAO#getDataSourceAxisInfo(java.lang.String)
   */
  public List<DataSourceAxisInfo> getDataSourceAxisInfo(String dataSourceID) throws SQLException {
    String sql = "select * from ODB_DATASOURCE_AXIS_CONFIG where DATASOURCE_ID=:dataSourceID";
    SqlParameterSource param = new MapSqlParameterSource("dataSourceID", dataSourceID);
    return jdbcTemp.query(sql, param, new DataSourceAxisInfoRowMapper());
  }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

   * com.odb.core.dao.ODBDAO#getDataSourceAxisDetailInfoListBy(java.lang.String
   * )
   */
  public List<DataSourceAxisDetailInfo> getDataSourceAxisDetailInfoListBy(String axisId) throws SQLException {
    String sql = "SELECT * FROM ODB_DATASOURCE_AXIS_DTL_CONFIG WHERE DATASOURCE_AXIS_ID=:dataSourceAxisID";
    SqlParameterSource param = new MapSqlParameterSource("dataSourceAxisID", axisId);
    return jdbcTemp.query(sql, param, new DataSourceAxisDetailInfoRowMapper());
  }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

    @Override
    public int addFileHistory(FileHistory fileHistory) {
        String sql = "insert into config_file_history(app_name, file_name, version, xml, comment, creator, create_time, is_published, publisher, publish_time) " +
                "values(:appName, :fileName, :version, :xml, :comment, :creator, :createTime, :published, :publisher, :publishTime)";
        SqlParameterSource bpsp = new BeanPropertySqlParameterSource(fileHistory);
        return getNamedParameterJdbcTemplate().update(sql, bpsp);
    }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

    @Override
    public int addApp(App app) {
        String sql = "insert into config_app(app_name, description, creator, create_time) " +
                "values(:appName, :description, :creator, :createTime)";
        SqlParameterSource bpsp = new BeanPropertySqlParameterSource(app);
        return getNamedParameterJdbcTemplate().update(sql, bpsp);
    }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

    @Override
    public int addFilePublished(FilePublished filePublished) {
        String sql = "insert into config_file_published(app_name, file_name, version, xml, md5) " +
                "values(:appName, :fileName, :version, :xml, :md5)";
        SqlParameterSource bpsp = new BeanPropertySqlParameterSource(filePublished);
        return getNamedParameterJdbcTemplate().update(sql, bpsp);
    }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

    @Override
    public int updateFilePublished(FilePublished filePublished) {
        String sql = "update config_file_published set version=:version, xml=:xml, md5=:md5 " +
                "where app_name=:appName and file_name=:fileName";
        SqlParameterSource bpsp = new BeanPropertySqlParameterSource(filePublished);
        return getNamedParameterJdbcTemplate().update(sql, bpsp);
    }
View Full Code Here

Examples of org.springframework.jdbc.core.namedparam.SqlParameterSource

    @Override
    public int addFileCurrent(FileCurrent fileCurrent) {
        String sql = "insert into config_file_current(app_name, file_name, version, xml, comment, creator, create_time, last_publish_version, last_publisher, last_publish_time) " +
                "values(:appName, :fileName, :version, :xml, :comment, :creator, :createTime, :lastPublishVersion, :lastPublisher, :lastPublishTime)";
        SqlParameterSource bpsp = new BeanPropertySqlParameterSource(fileCurrent);
        return getNamedParameterJdbcTemplate().update(sql, bpsp);
    }
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.