add method

This commit is contained in:
looly
2021-12-07 18:17:20 +08:00
parent c53b77924d
commit 5009ee6de8
4 changed files with 77 additions and 8 deletions

View File

@@ -1,11 +1,14 @@
package cn.hutool.db;
import cn.hutool.db.handler.EntityListHandler;
import cn.hutool.db.sql.Condition;
import cn.hutool.log.StaticLog;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
@@ -109,4 +112,18 @@ public class DbTest {
db.del("user", "name", "unitTestUser2");
});
}
@Test
@Ignore
public void queryFetchTest() throws SQLException {
// https://gitee.com/dromara/hutool/issues/I4JXWN
Db.use().query((conn->{
PreparedStatement ps = conn.prepareStatement("select * from table",
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY);
ps.setFetchSize(Integer.MIN_VALUE);
ps.setFetchDirection(ResultSet.FETCH_FORWARD);
return ps;
}), new EntityListHandler());
}
}