Example usage for org.springframework.jdbc.core JdbcTemplate JdbcTemplate

List of usage examples for org.springframework.jdbc.core JdbcTemplate JdbcTemplate

Introduction

In this page you can find the example usage for org.springframework.jdbc.core JdbcTemplate JdbcTemplate.

Prototype

public JdbcTemplate(DataSource dataSource) 

Source Link

Document

Construct a new JdbcTemplate, given a DataSource to obtain connections from.

Usage

From source file:com.javacodegags.waterflooding.model.CriteriaImplemented.java

public CriteriaImplemented(DataSource dataSource) {
    this.jdbcTemplate = new JdbcTemplate(dataSource);
}

From source file:com.dai.dao.SelecaoTreinoDaoImpl.java

@Override
public void apagaST(int idUtilizador, int idTreino) {

    String sql = "delete from selecaoTreino where utilizador_idUtilizador_st =" + idUtilizador
            + "and treino_idtreino = " + idTreino;
    JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
    jdbcTemplate.update(sql);//from  w  w  w .jav a  2 s .c o m

}

From source file:com.mc.dao.JdbcDaoImpl.java

@Autowired
public void setDataSource(DataSource dataSource) {
    //      this.dataSource = dataSource;
    this.jdbcTemplate = new JdbcTemplate(dataSource);
}

From source file:demo.domain.BookRepositoryImpl.java

@Autowired
public BookRepositoryImpl(DataSource dataSource) {
    jdbcTemplate = new JdbcTemplate(dataSource);
}

From source file:io.spring.batch.JdbcSimilaritiesItemWriter.java

public JdbcSimilaritiesItemWriter(DataSource dataSource) {
    Assert.notNull(dataSource, "A datasource is required");

    this.jdbcTemplate = new JdbcTemplate(dataSource);
}

From source file:com.recomdata.grails.rositaui.utils.ValidationErrorCache.java

public ValidationErrorCache(DataSource ds, Integer threshold) {
    this.dataSource = ds;
    if (dataSource != null) {
        this.jdbc = new JdbcTemplate(dataSource);
    }/* w  w w.j a  v  a 2 s .  c  o  m*/
    if (threshold != null && threshold > 0) {
        OBJECT_THRESHOLD = threshold;
    }

    this.validationErrors = new ValidationErrorBatchPreparedStatementSetter(threshold);

}

From source file:com.manning.siia.batch.PaymentWriter.java

public PaymentWriter(DataSource dataSource) {
    paymentInsert = new SimpleJdbcInsert(dataSource).withTableName("PAYMENTS").usingColumns("RECIPIENT",
            "PAYEE", "AMOUNT", "PAY_DATE");
    accountUpdate = new JdbcTemplate(dataSource);
}

From source file:com.billkoch.examples.admin.config.AdminConfig.java

@Bean
public JdbcTemplate adminJdbcTemplate() {
    return new JdbcTemplate(adminDataSource());
}

From source file:org.kordamp.griffon.addressbook.spring.JdbcTemplateProvider.java

@Override
public JdbcTemplate get() {
    return new JdbcTemplate(getDataSource(ObjectFactory.KEY_DEFAULT));
}

From source file:com.quartzdesk.executor.dao.AbstractDao.java

/**
 * Set the Hibernate SessionFactory to be used by this DAO.
 * Will automatically create a HibernateTemplate for the given SessionFactory.
 *
 * @see #createHibernateTemplate/*from  www . j av a 2  s .  c om*/
 * @see #setHibernateTemplate
 */
@Required
public final void setDataSource(DataSource dataSource) {
    jdbcTemplate = new JdbcTemplate(dataSource);
}