Examples of SimpleJdbcTemplate


Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

     * Method to set the datasource and generate a JdbcTemplate.
     *
     * @param dataSource the datasource to use.
     */
    public final void setDataSource(final DataSource dataSource) {
        this.jdbcTemplate = new SimpleJdbcTemplate(dataSource);
        this.dataSource = dataSource;
    }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

     
    }
   
    String actualSqlStatement = evaluateContent(instance, this.getSqlStatement()).toString().trim();
   
    SimpleJdbcTemplate simpleJdbcTemplate = new SimpleJdbcTemplate(ds);
   
    if (this.getOperation() == OPERATION_OTHER) {
     
      int maxOfProcessValueCount = 0;
     
      for (ParameterContext pc : this.getSqlArguments()) {
        int c = instance.getMultiple("", pc.getVariable().getName()).size();
        if (c > maxOfProcessValueCount)
          maxOfProcessValueCount = c;
      }
     
      Map<String, Object>[] paramMaps = new HashMap[maxOfProcessValueCount];
      for (int i = 0; i < paramMaps.length; i++) {
        paramMaps[i] = new HashMap<String, Object>();
       
        for (ParameterContext pc : this.getSqlArguments()) {
          ProcessVariableValue pvv = instance.getMultiple("", pc.getVariable().getName());
          Object objValue = null;
         
          if (pvv.size() >= i) {
            pvv.setCursor(i);
            objValue = pvv.getValue();
            if (objValue instanceof Calendar) {
              objValue = new Timestamp(((Calendar) objValue).getTimeInMillis());
            } else if (objValue instanceof java.util.Date) {
              objValue = new Timestamp(((java.util.Date) objValue).getTime());
            }
            pvv.beforeFirst();
          }
                   
          paramMaps[i].put(pc.getArgument().getText(), objValue);
        }
      }
     
      simpleJdbcTemplate.batchUpdate(actualSqlStatement, paramMaps);
     
    } else if (this.getOperation() == OPERATION_SELECT) {
     
      Map<String, Object> paramMap = new HashMap<String, Object>();
      for (ParameterContext pc : this.getSqlArguments()) {
        paramMap.put(pc.getArgument().getText(), instance.get(pc.getVariable().getName()));
      }
     
      List<Map<String, Object>> results = simpleJdbcTemplate.queryForList(actualSqlStatement, paramMap);
     
      for (ParameterContext pc : this.getResultSet()) {
        ProcessVariableValue pvv = new ProcessVariableValue();
       
        for (Map<String, Object> resultMap : results) {
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

  @Override
  public void setDataSource(DataSource dataSource) {
    super.setDataSource(dataSource);
    // JdbcTemplate will be identically configured
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(this.jdbcTemplate);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

  /**
   * Set the DataSource, typically provided via Dependency Injection.
   */
  @Autowired
  public void setDataSource(DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

   * Set the DataSource, typically provided via Dependency Injection.
   * @param dataSource The DataSource to inject
   */
  @Autowired
  public void setDataSource(DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

   * Set the DataSource, typically provided via Dependency Injection.
   * @param dataSource the DataSource to inject
   */
  @Autowired
  public void setDataSource(final DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

  @Override
  public void setDataSource(DataSource dataSource) {
    super.setDataSource(dataSource);
    // JdbcTemplate will be identically configured
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(this.jdbcTemplate);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

   * Set the DataSource, typically provided via Dependency Injection.
   * @param dataSource the DataSource to inject
   */
  @Autowired
  public void setDataSource(final DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

  /**
   * Set the DataSource, typically provided via Dependency Injection.
   */
  @Autowired
  public void setDataSource(DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
  }
View Full Code Here

Examples of org.springframework.jdbc.core.simple.SimpleJdbcTemplate

   * Set the DataSource, typically provided via Dependency Injection.
   * @param dataSource The DataSource to inject
   */
  @Autowired
  public void setDataSource(DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
  }
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.