DAO层调用数据库的公用方法

接口类
package com.lhw.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public interface DaoManager {

/**
* 获取所有列表集合
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public List<Map<String, Object>> getList(String sql, Connection conn) throws SQLException;

/**
*
* @param list
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public List<Map<String, Object>> getList(List<?> list , String sql, Connection conn) throws SQLException;

/**
*
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public ResultSet executeQuery(String sql, Connection conn) throws SQLException;

/**
*
* @param list
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public ResultSet executeQuery(List<?> list ,String sql, Connection conn) throws SQLException;

/**
*
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int update(String sql, Connection conn) throws SQLException;

/**
*
* @param list
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int update(List<?> list ,String sql, Connection conn) throws SQLException;

/**
*
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int delete(String sql, Connection conn) throws SQLException;

/**
*
* @param list
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int delete(List<?> list ,String sql, Connection conn) throws SQLException;

/**
*
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int insert(String sql, Connection conn) throws SQLException;

/**
*
* @param list
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int insert(List<?> list ,String sql, Connection conn) throws SQLException;

/**
*
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int executeUpdate(String sql, Connection conn) throws SQLException ;

/**
*
* @param pramList
* @param sql
* @param conn
* @return
* @throws SQLException
*/
public int executeUpdate(List<?> pramList,String sql, Connection conn) throws SQLException ;

/**
*
*/
public void close();
}

你可能感兴趣的:(DAO,sql)