没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
5页
实现了简单的ORM增删改查。 <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="dataSource"> <ref local="dataSource" /> </property> </bean>
资源推荐
资源详情
资源评论
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
/**
*
* @author cbwleft
*
*/
public class BaseDAO extends JdbcDaoSupport {
public BaseDAO() {
}
//查询
public List<Map<String, Object>> query(String sql, Object... args) {
// sql is given to create a PreparedStatement,and args to match the ?.
// this method will return you a list of map.
return getJdbcTemplate().queryForList(sql, args);
}
//以id降序返回该表所有数据
public List<Map<String, Object>> queryAll(String tableName, String keyName) {
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
/**
*
* @author cbwleft
*
*/
public class BaseDAO extends JdbcDaoSupport {
public BaseDAO() {
}
//查询
public List<Map<String, Object>> query(String sql, Object... args) {
// sql is given to create a PreparedStatement,and args to match the ?.
// this method will return you a list of map.
return getJdbcTemplate().queryForList(sql, args);
}
//以id降序返回该表所有数据
public List<Map<String, Object>> queryAll(String tableName, String keyName) {
cbwleft
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页