阅读(4405) (1)

HasorDB 使用原始连接

2021-12-30 10:59:52 更新

有时候我们需要获取最原始的 ​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);