List of usage examples for org.apache.commons.dbutils QueryRunner QueryRunner
public QueryRunner(DataSource ds)
DataSource
to use. From source file:com.pinterest.deployservice.db.DBTokenRolesDAOImpl.java
@Override public void delete(String userName, String resourceId, Resource.Type resourceType) throws Exception { new QueryRunner(dataSource).update(DELETE_TEMPLATE, userName, resourceId, resourceType.toString()); }
From source file:com.pinterest.deployservice.db.DBGroupDAOImpl.java
@Override public List<String> getEnvsByGroupName(String groupName) throws Exception { return new QueryRunner(dataSource).query(GET_ENV_BY_GROUP, SingleResultSetHandlerFactory.<String>newListObjectHandler(), groupName); }
From source file:com.pinterest.arcee.db.DBSpotAutoScalingDAOImpl.java
@Override public List<SpotAutoScalingBean> getAutoScalingGroupsByCluster(String clusterName) throws Exception { ResultSetHandler<List<SpotAutoScalingBean>> h = new BeanListHandler<>(SpotAutoScalingBean.class); return new QueryRunner(dataSource).query(GET_ASG_BY_CLUSTER, h, clusterName); }
From source file:com.pinterest.arcee.db.DBAlarmDAOImpl.java
@Override public List<AsgAlarmBean> getAlarmInfosByGroup(String groupName) throws Exception { ResultSetHandler<List<AsgAlarmBean>> h = new BeanListHandler<AsgAlarmBean>(AsgAlarmBean.class); return new QueryRunner(dataSource).query(GET_ALARM_BY_GROUP, h, groupName); }
From source file:com.pinterest.deployservice.db.DBScheduleDAOImpl.java
@Override public void delete(String scheduleId) throws Exception { new QueryRunner(dataSource).update(DELETE_SCHEDULE, scheduleId); }
From source file:com.pinterest.arcee.db.DBImageDAOImpl.java
@Override public List<ImageBean> getImages(String appName, int pageIndex, int pageSize) throws Exception { QueryRunner run = new QueryRunner(dataSource); ResultSetHandler<List<ImageBean>> h = new BeanListHandler<>(ImageBean.class); if (StringUtils.isNotEmpty(appName)) { return run.query(GET_AMI_BY_APPNAME, h, appName, (pageIndex - 1) * pageSize, pageSize); } else {/*from w w w.jav a2 s .c om*/ return run.query(GET_ALL_AMI, h, (pageIndex - 1) * pageSize, pageSize); } }
From source file:com.pinterest.deployservice.db.DBRatingsDAOImpl.java
@Override public List<RatingBean> getRatingsByAuthor(String author) throws Exception { ResultSetHandler<List<RatingBean>> h = new BeanListHandler<RatingBean>(RatingBean.class); QueryRunner run = new QueryRunner(this.dataSource); return run.query(GET_USER_RATINGS, h, author); }
From source file:com.pinterest.deployservice.db.DBTagDAOImpl.java
@Override public TagBean getById(String id) throws Exception { return new QueryRunner(basicDataSource).query(GET_TAG_BY_ID_TEMPLATE, new BeanHandler<>(TagBean.class), id); }
From source file:com.fluke.database.dataservice.EODDao.java
public List<EODTicker> getEODTickers(String equity, Date fromDate, Date toDate) throws SQLException { QueryRunner run = new QueryRunner(DatabaseProperty.getDataSource()); String sql = "select * from EOD where equity = ? and date between '%s' and '%s' order by date"; String from = Util.getDate(fromDate); String to = Util.getDate(toDate); sql = String.format(sql, from, to); Object[] params = new Object[] { equity }; ResultSetHandler rsh = new BeanListHandler(EODTicker.class); return filterDupicateDate((List<EODTicker>) run.query(sql, rsh, params)); }
From source file:com.pinterest.deployservice.db.DBHotfixDAOImpl.java
@Override public void delete(String id) throws Exception { new QueryRunner(dataSource).update(DELETE_HOTFIX, id); }