db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r771597 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
Date Tue, 05 May 2009 07:16:41 GMT
Author: kahatlen
Date: Tue May  5 07:16:41 2009
New Revision: 771597

URL: http://svn.apache.org/viewvc?rev=771597&view=rev
Log:
Use helper methods in OffsetFetchNextTest to make it simpler and to ensure that statements
are closed.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java?rev=771597&r1=771596&r2=771597&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
Tue May  5 07:16:41 2009
@@ -130,15 +130,12 @@
     public void testNewKeywordNonReserved()
             throws Exception
     {
-        getConnection().prepareStatement(
-            "select a,b as OFFSET from t1 OFFSET 0 rows");
+        prepareStatement("select a,b as OFFSET from t1 OFFSET 0 rows");
 
         // Column and table correlation name usage
-        getConnection().prepareStatement(
-            "select a,b from t1 AS OFFSET");
+        prepareStatement("select a,b from t1 AS OFFSET");
 
-        getConnection().prepareStatement(
-            "select a,b OFFSET from t1 OFFSET");
+        prepareStatement("select a,b OFFSET from t1 OFFSET");
     }
 
 
@@ -366,7 +363,7 @@
         Statement stm = createStatement(ResultSet.TYPE_FORWARD_ONLY,
                                         ResultSet.CONCUR_UPDATABLE);
 
-        getConnection().setAutoCommit(false);
+        setAutoCommit(false);
 
         /*
          * offset 0 rows (a no-op), update a row and verify result
@@ -461,7 +458,7 @@
         Statement stm = createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                                         ResultSet.CONCUR_UPDATABLE);
 
-        getConnection().setAutoCommit(false);
+        setAutoCommit(false);
 
         /*
          * offset 0 rows (a no-op), update a row and verify result
@@ -616,13 +613,13 @@
     public void testBigTable() throws SQLException {
         Statement stm = createStatement();
 
-        getConnection().setAutoCommit(false);
+        setAutoCommit(false);
 
         stm.executeUpdate("declare global temporary table session.t (i int) " +
                           "on commit preserve rows not logged");
 
         PreparedStatement ps =
-            getConnection().prepareStatement("insert into session.t values ?");
+            prepareStatement("insert into session.t values ?");
 
         for (int i=1; i <= 100000; i++) {
             ps.setInt(1, i);



Mime
View raw message