Fixed some resultset creation
This commit is contained in:
parent
48bad82439
commit
d9b88ed303
@ -112,7 +112,7 @@ public class ResultSetLiveTest {
|
|||||||
@Test
|
@Test
|
||||||
public void givenDbConnectionE_whenRowCount_thenCorrect() throws SQLException {
|
public void givenDbConnectionE_whenRowCount_thenCorrect() throws SQLException {
|
||||||
int numOfRows = 0;
|
int numOfRows = 0;
|
||||||
try (PreparedStatement pstmt = dbConnection.prepareStatement("select * from employees", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = pstmt.executeQuery()) {
|
try (PreparedStatement pstmt = dbConnection.prepareStatement("select * from employees", ResultSet.TYPE_SCROLL_SENSITIVE); ResultSet rs = pstmt.executeQuery()) {
|
||||||
rs.last();
|
rs.last();
|
||||||
numOfRows = rs.getRow();
|
numOfRows = rs.getRow();
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ public class ResultSetLiveTest {
|
|||||||
@Test
|
@Test
|
||||||
public void givenDbConnectionG_whenAbsoluteNavigation_thenCorrect() throws SQLException {
|
public void givenDbConnectionG_whenAbsoluteNavigation_thenCorrect() throws SQLException {
|
||||||
Employee secondEmployee = null;
|
Employee secondEmployee = null;
|
||||||
try (PreparedStatement pstmt = dbConnection.prepareStatement("select * from employees", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = pstmt.executeQuery()) {
|
try (PreparedStatement pstmt = dbConnection.prepareStatement("select * from employees", ResultSet.TYPE_SCROLL_SENSITIVE); ResultSet rs = pstmt.executeQuery()) {
|
||||||
rs.absolute(2);
|
rs.absolute(2);
|
||||||
secondEmployee = populateResultSet(rs);
|
secondEmployee = populateResultSet(rs);
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ public class ResultSetLiveTest {
|
|||||||
@Test
|
@Test
|
||||||
public void givenDbConnectionI_whenNavigation_thenCorrect() throws SQLException {
|
public void givenDbConnectionI_whenNavigation_thenCorrect() throws SQLException {
|
||||||
Employee firstEmployee = null;
|
Employee firstEmployee = null;
|
||||||
try (PreparedStatement pstmt = dbConnection.prepareStatement("select * from employees", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = pstmt.executeQuery()) {
|
try (PreparedStatement pstmt = dbConnection.prepareStatement("select * from employees", ResultSet.TYPE_SCROLL_SENSITIVE); ResultSet rs = pstmt.executeQuery()) {
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
Employee employee = populateResultSet(rs);
|
Employee employee = populateResultSet(rs);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user