List of usage examples for org.springframework.jdbc.core JdbcTemplate JdbcTemplate
public JdbcTemplate(DataSource dataSource)
From source file:org.cleverbus.admin.dao.MessageReportDaoJdbcImpl.java
@Autowired @Qualifier(value = "dataSource") public void setDataSource(DataSource dataSource) { Assert.notNull(dataSource, "the dataSource must not be null"); this.jdbcTemplate = new JdbcTemplate(dataSource); }
From source file:org.jasig.portal.cas.authentication.handler.support.PortalPersonDirUserPasswordDao.java
/** * @param dataSource the dataSource to set *///from w w w.j a v a2 s . c om public void setDataSource(DataSource dataSource) { this.dataSource = dataSource; this.jdbcTemplate = new JdbcTemplate(this.dataSource); }
From source file:cn.edu.ahpu.common.dao.key.impl.DefaultUniqueTableApp.java
public DefaultUniqueTableApp(DataSource dataSource) { jdbcTemplate = new JdbcTemplate(dataSource); this.selectSQL = "SELECT code FROM TPC_PRIMARYKEY WHERE name = ? FOR UPDATE"; this.updateSQL = "UPDATE TPC_PRIMARYKEY SET code = code + ? WHERE name = ? "; this.insertSQL = "INSERT INTO TPC_PRIMARYKEY (code, name) VALUES (?, ?)"; }
From source file:com.recber.dao.UserDaoImpl.java
@Override public void updateData(User user) { String sql = "UPDATE user set first_name = ?,last_name = ?, face = ?, city = ? where user_id = ?"; JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); jdbcTemplate.update(sql, new Object[] { user.getFirstName(), user.getLastName(), user.getFace(), user.getCity(), user.getUserId() }); }
From source file:org.jasig.portal.cas.authentication.handler.support.PortalPersonDirUserPasswordDaoTest.java
@Override protected void setUp() throws Exception { this.dataSource = new SimpleDriverDataSource(new org.hsqldb.jdbcDriver(), "jdbc:hsqldb:mem:CasTest", "sa", "");/*from w w w . j a va 2s. c o m*/ this.jdbcTemplate = new JdbcTemplate(this.dataSource); this.jdbcTemplate .execute("CREATE TABLE UP_PERSON_DIR (USER_NAME VARCHAR(1000), ENCRPTD_PSWD VARCHAR(1000))"); this.userPasswordDao = new PortalPersonDirUserPasswordDao(); this.userPasswordDao.setDataSource(this.dataSource); }
From source file:com.beezas.dao.ContactDaoImpl.java
@Override public void insertData(Contact contact) { if (contact.getId() > 0) { // This is for updating data String sql = "UPDATE contact SET MEDIA_NAME=?, CTYPE_NAME=?, EMAIL=?, EVENT_DISPLAY=?, CONTACT_FIRST_NAME=?," + "CONTACT_LAST_NAME=?, CONTACT_EMAIL=?, CONTACT_PHNO=? WHERE ID=?"; jdbcTemplate.update(sql, contact.getMedianame(), contact.getContacttypename(), contact.getEmail(), contact.getEventDisplay(), contact.getFname(), contact.getLname(), contact.getContactemail(), contact.getPhonenumber(), contact.getId()); } else {/*from w w w . j a v a 2s . c om*/ //This is for inserting data String sql = "INSERT INTO CONTACT(ID, MEDIA_NAME, CTYPE_NAME, EMAIL, EVENT_DISPLAY, CONTACT_FIRST_NAME," + " CONTACT_LAST_NAME, CONTACT_EMAIL, CONTACT_PHNO)" + "VALUES(seq_id.nextval,?,?,?,?,?,?,?,?)"; jdbcTemplate = new JdbcTemplate(dataSource); jdbcTemplate.update(sql, new Object[] { contact.getMedianame(), contact.getContacttypename(), contact.getEmail(), contact.getEventDisplay(), contact.getFname(), contact.getLname(), contact.getContactemail(), contact.getPhonenumber() }); } }
From source file:com.iucosoft.eavertizare.dao.impl.ClientsDaoImpl.java
@Override public void save(Firma firma, Client client) { String query = "INSERT INTO " + firma.getTabelaClientiLocal() + " VALUES(?, ?, ?, ?, ?, ?, ?, ?)"; JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); Object[] args = new Object[] { client.getId(), client.getNume(), client.getPrenume(), client.getNrTelefon(), client.getEmail(), new java.sql.Timestamp(client.getDateExpirare().getTime()), firma.getId(), 0 }; jdbcTemplate.update(query, args);/*ww w . j a v a 2s . c o m*/ }
From source file:com.beezas.dao.EventDaoImpl.java
public List<SubCategory> getSubCategories() { List categoryList = new ArrayList(); String sql = "select * from sub_category"; JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); categoryList = jdbcTemplate.query(sql, new SubCategoryRowMapper()); return categoryList; }
From source file:uta.ak.usttmp.console.controller.UserController.java
/** * Saves the static list of users in model and renders it * via freemarker template./*from w w w . j av a 2 s. c o m*/ * * @param model * @return The index view (FTL) */ @RequestMapping(value = "/index", method = RequestMethod.GET) public String index(@ModelAttribute("model") ModelMap model) { JdbcTemplate jt = new JdbcTemplate(dataSource); return "index"; }
From source file:com.lanacion.adminsiteln.dao.infografiasrepository.InfografiasRepositoryImpl.java
@Override public void setDataSource(DataSource dataSource2) { /*/*w ww .j a va 2 s. c o m*/ BasicDataSource dataConn=new BasicDataSource(); dataConn.setDriverClassName("com.mysql.jdbc.Driver"); dataConn.setUrl("jdbc:mysql://localhost:8889/DiarioLaNacion"); dataConn.setUsername("root"); dataConn.setPassword("root"); if(dataSource == null){ System.out.println("Es nulo loco++++++!!!!!"); } */ this.dataSource = dataSource2; System.out.println("Entro a mysql*************"); this.jdbcTemplateObject = new JdbcTemplate(this.dataSource); }