db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1067991 - in /db/derby/code/trunk/java: client/org/apache/derby/client/net/NetConnection40.java engine/org/apache/derby/impl/jdbc/EmbedConnection40.java testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionMethodsTest.java
Date Mon, 07 Feb 2011 16:04:25 GMT
Author: rhillegas
Date: Mon Feb  7 16:04:25 2011
New Revision: 1067991

URL: http://svn.apache.org/viewvc?rev=1067991&view=rev
Log:
DERBY-4869: Always raise SQLFeatureNotSupportedException when Connection.get/setNetworkTimeout()
is called.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionMethodsTest.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java?rev=1067991&r1=1067990&r2=1067991&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection40.java Mon Feb
 7 16:04:25 2011
@@ -453,33 +453,11 @@ public class  NetConnection40 extends or
 
     public int getNetworkTimeout() throws SQLException
     {
-        try
-        {
-            if (agent_.loggingEnabled()) {
-                agent_.logWriter_.traceEntry(this, "getNetworkTimeout");
-            }
-            checkForClosedConnection();
-        }
-        catch ( SqlException se )
-        {
-            throw se.getSQLException();
-        }
         throw SQLExceptionFactory.notImplemented ("getNetworkTimeout");
     }
     
     public void setNetworkTimeout( Executor executor, int milliseconds ) throws SQLException
     {
-        try
-        {
-            if (agent_.loggingEnabled()) {
-                agent_.logWriter_.traceEntry(this, "setNetworkTimeout");
-            }
-            checkForClosedConnection();
-        }
-        catch ( SqlException se )
-        {
-            throw se.getSQLException();
-        }
         throw SQLExceptionFactory.notImplemented ("setNetworkTimeout");
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java?rev=1067991&r1=1067990&r2=1067991&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java Mon
Feb  7 16:04:25 2011
@@ -320,13 +320,11 @@ public class EmbedConnection40 extends E
     
     public int getNetworkTimeout() throws SQLException
     {
-        checkIfClosed();
         throw Util.notImplemented();
     }
     
     public void setNetworkTimeout( Executor executor, int milliseconds ) throws SQLException
     {
-        checkIfClosed();
         throw Util.notImplemented();
     }
     

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionMethodsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionMethodsTest.java?rev=1067991&r1=1067990&r2=1067991&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionMethodsTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionMethodsTest.java
Mon Feb  7 16:04:25 2011
@@ -647,20 +647,20 @@ public class ConnectionMethodsTest exten
         
         try {
             wrapper.getNetworkTimeout();
-            fail( "Should object that the connection is closed." );
+            fail( "Should raise an Unimplemented Feature exception." );
         }
         catch (SQLException se)
         {
-            assertSQLState( CLOSED_CONNECTION, se );
+            assertEquals( SQLFeatureNotSupportedException.class.getName(), se.getClass().getName()
);
         }
         
         try {
             wrapper.setNetworkTimeout( null, 3 );
-            fail( "Should object that the connection is closed." );
+            fail( "Should raise an Unimplemented Feature exception." );
         }
         catch (SQLException se)
         {
-            assertSQLState( CLOSED_CONNECTION, se );
+            assertEquals( SQLFeatureNotSupportedException.class.getName(), se.getClass().getName()
);
         }
     }
     



Mime
View raw message