db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1163616 - in /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda: DRDAConnThread.java DRDAStatement.java
Date Wed, 31 Aug 2011 13:24:46 GMT
Author: kahatlen
Date: Wed Aug 31 13:24:46 2011
New Revision: 1163616

URL: http://svn.apache.org/viewvc?rev=1163616&view=rev
Log:
DERBY-5396: DRDAStatement and DRDAConnThread swallow IOExceptions

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=1163616&r1=1163615&r2=1163616&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Wed Aug 31
13:24:46 2011
@@ -8940,18 +8940,22 @@ class DRDAConnThread extends Thread {
                                 
         return 0; // SECMEC_USRSSBPWD is supported
     }
-    
-    private static void closeStream(InputStream stream){
-	
-	try{
-	    if (stream != null)
-		stream.close();
-	    
-	} catch (IOException e) {
-	    Util.javaException(e);
-	    
-	}
-	
+
+    /**
+     * Close a stream.
+     *
+     * @param stream the stream to close (possibly {@code null})
+     * @throws SQLException wrapped around an {@code IOException} if closing
+     * the stream failed
+     */
+    private static void closeStream(InputStream stream) throws SQLException {
+        try {
+            if (stream != null) {
+                stream.close();
+            }
+        } catch (IOException e) {
+            throw Util.javaException(e);
+        }
     }
     
     

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java?rev=1163616&r1=1163615&r2=1163616&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java Wed Aug 31
13:24:46 2011
@@ -678,7 +678,7 @@ class DRDAStatement
 		try {
 			drdaParamState_.drainStreamedParameter();
 		} catch (IOException e) { 
-			Util.javaException(e);
+			throw Util.javaException(e);
 		}
 		// java.sql.Statement says any result sets that are opened
 		// when the statement is re-executed must be closed; this



Mime
View raw message