<分区>
考虑一个以主键作为列“id”的表
必须查询 id 范围为 [ 1, 2, 3, 4 ...]
有2个选项-
1)
Select * from Table where id = 1;
Select * from Table where id = 2;
Select * from Table where id = 3;
Select * from Table where id = 4;
2)
Select * from Table where id in ( 1, 2, 3, 4 );
对于 Oracle as Databse 和使用 Spring JDBC Template 进行持久化,这两者中哪一个在性能上更好。从应用程序的角度抛开内存限制,假设数据集 1、2、3、4 将在 Java 数据结构的限制范围内。
它使用数据库连接池。