Skip to content

Commit

Permalink
JDBC-262 Move tests in src/test_30 to src/test if they are not specif…
Browse files Browse the repository at this point in the history
…ic to JDBC 3.0
  • Loading branch information
mrotteveel committed Aug 6, 2012
1 parent 11a5b3f commit 59f0e26
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 85 deletions.
47 changes: 46 additions & 1 deletion src/test/org/firebirdsql/jdbc/TestFBResultSet.java
Expand Up @@ -1176,7 +1176,52 @@ public void testRelAlias() throws Exception {
}
}

public static void main(String[] args) {
public void testUpdatableHoldableResultSet() throws Exception {

connection.setAutoCommit(true);

int recordCount = 10;
PreparedStatement ps = connection.prepareStatement("INSERT INTO test_table("
+ "id, long_str) VALUES (?, ?)");

try {
for (int i = 0; i < recordCount; i++) {
ps.setInt(1, i);
ps.setString(2, "oldString" + i);
ps.executeUpdate();
}
} finally {
ps.close();
}

connection.setAutoCommit(false);

Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE, ResultSet.HOLD_CURSORS_OVER_COMMIT);

try {
ResultSet rs = stmt.executeQuery("SELECT id, long_str FROM test_table");

while (rs.next()) {
rs.updateString(2, rs.getString(2) + "a");
rs.updateRow();
connection.commit();
}

int counter = 0;

rs = stmt.executeQuery("SELECT id, long_str FROM test_table");
while (rs.next()) {
assertEquals("oldString" + counter + "a", rs.getString(2));
counter++;
}

} finally {
stmt.close();
}
}

public static void main(String[] args) {
TestRunner.run(new TestFBResultSet("testMemoryGrowth"));
}

Expand Down
84 changes: 0 additions & 84 deletions src/test_30/org/firebirdsql/jdbc/TestFBResultSet3_0.java

This file was deleted.

0 comments on commit 59f0e26

Please sign in to comment.