Skip to main content

使用原始连接

有时候我们需要获取最原始的 Connection 那么可以采用下面方式:

ConnectionCallback<List<TestUser>> callBack = new ConnectionCallback<List<TestUser>>() {
public List<TestUser> doInConnection(Connection con) throws SQLException {
List<TestUser> result = ...
// do some thing
return result;
}
};

List<TestUser> resultList = jdbcTemplate.execute(callBack);