mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-16 21:01:10 +08:00
#304 made JDBC methods use same query
This commit is contained in:
parent
a89e90f36f
commit
cfe9e00fe6
@ -55,7 +55,7 @@ public class QueryPerformanceTest {
|
||||
Connection conn = Connections.getConnection();
|
||||
long start = System.currentTimeMillis();
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
PreparedStatement stmt = conn.prepareStatement("select name from companies where id = ?");
|
||||
PreparedStatement stmt = conn.prepareStatement("select COMPANIES.NAME from COMPANIES COMPANIES where COMPANIES.ID = ?");
|
||||
try {
|
||||
stmt.setInt(1, i);
|
||||
ResultSet rs = stmt.executeQuery();
|
||||
@ -73,13 +73,13 @@ public class QueryPerformanceTest {
|
||||
}
|
||||
System.err.println("jdbc by id " + (System.currentTimeMillis() - start));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void JDBC2() throws SQLException {
|
||||
Connection conn = Connections.getConnection();
|
||||
long start = System.currentTimeMillis();
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
PreparedStatement stmt = conn.prepareStatement("select id from companies where name = ?");
|
||||
PreparedStatement stmt = conn.prepareStatement("select COMPANIES.ID from COMPANIES COMPANIES where COMPANIES.NAME = ?");
|
||||
try {
|
||||
stmt.setString(1, String.valueOf(i));
|
||||
ResultSet rs = stmt.executeQuery();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user