db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r355437 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/ testing/org/apache/derbyTesting/functionTe...
Date Fri, 09 Dec 2005 10:20:15 GMT
Author: tmnk
Date: Fri Dec  9 02:20:02 2005
New Revision: 355437

URL: http://svn.apache.org/viewcvs?rev=355437&view=rev
Log:
- rollback DERBY-721 and DERBY-721_2 because they will implicitly restrict spec of network
driver. - Patch by Tomohito Nakayama (tomonaka@basil.ocn.ne.jp)

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/UTF8Reader.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java?rev=355437&r1=355436&r2=355437&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/BinaryToRawStream.java Fri
Dec  9 02:20:02 2005
@@ -21,8 +21,6 @@
 package org.apache.derby.impl.jdbc;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.types.Resetable;
-import org.apache.derby.iapi.error.StandardException;
 
 import java.io.InputStream;
 import java.io.IOException;
@@ -32,11 +30,6 @@
 	Converts a stream containing the Cloudscape stored binary form
 	to one that just contains the application's data.
 	Simply remove the length information.
-
-	If source stream implements Resetable interface , 
-	the source can be shared among other objects and 
-	not closed when close method of this class was called.
-
 */
 final class BinaryToRawStream
 extends java.io.FilterInputStream
@@ -103,26 +96,4 @@
 			//	len++;
 		}
 	}
-    
-    
-    public void close() throws IOException{
-	
-	//Escape from closing source InputStream ,
-	//because source InputStream can be shared between other stream.
-	
-	if(in instanceof Resetable){
-	    try{
-		((Resetable) in).resetStream();
-		
-	    }catch(StandardException e){
-		e.printStackTrace();
-		throw new IOException(e.getMessage());
-	    }
-	    
-	}else{
-	    super.close();
-	    
-	}
-    }
-    
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java?rev=355437&r1=355436&r2=355437&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java Fri Dec  9 02:20:02
2005
@@ -251,17 +251,8 @@
 			}
 			finally
 			{
-			    if (clobReader != null){
-				
-				try{
-				    clobReader.close();
-				    
-				}catch(IOException e){
-				    e.printStackTrace();
-				    throw new SQLException(e.getMessage());
-				    
-				}
-			    }
+				if (clobReader != null)
+					clobReader.close();
 				restoreContextStack();
 			}
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/UTF8Reader.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/UTF8Reader.java?rev=355437&r1=355436&r2=355437&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/UTF8Reader.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/UTF8Reader.java Fri Dec  9
02:20:02 2005
@@ -26,16 +26,9 @@
 import java.io.UTFDataFormatException;
 import java.io.EOFException;
 import java.sql.SQLException;
-import org.apache.derby.iapi.types.Resetable;
-import org.apache.derby.iapi.error.StandardException;
-    
 
 /**
- *
- * If source InputStream of this class is Resetable, close method of this class reset the
source instead of close it,
- * because the source InputStream can be shared.
- *
- */
+*/
 public final class UTF8Reader extends Reader
 {
 
@@ -147,7 +140,7 @@
 
 	}
 
-	public void close() throws IOException
+	public void close()
 	{
 		synchronized (lock) {
 			closeIn();
@@ -219,33 +212,23 @@
 	*/
 
 
-	private void closeIn() throws IOException {
+	private void closeIn() {
 		if (in != null) {
 			try {
-			    
-			    if(in instanceof Resetable){
-				((Resetable) in).resetStream();
-				
-			    }else{
 				in.close();
-			    }
-			    
-			} catch (StandardException e) {
-			    e.printStackTrace();
-			    throw new IOException(e.getMessage());
-			    
+			} catch (IOException ioe) {
 			} finally {
 				in = null;
 			}
 		}
 	}
-	private IOException utfFormatException(String s) throws IOException {
+	private IOException utfFormatException(String s) {
 		noMoreReads = true;
 		closeIn();
 		return new UTFDataFormatException(s);
 	}
 
-	private IOException utfFormatException() throws IOException {
+	private IOException utfFormatException() {
 		noMoreReads = true;
 		closeIn();
 		return new UTFDataFormatException();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out?rev=355437&r1=355436&r2=355437&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultsetStream.out
Fri Dec  9 02:20:02 2005
@@ -14,9 +14,4 @@
 Test of getAsciiStream
 U+0041U+0042U+0043U+0044U+0045U+0046U+0047U+00c0U+00c1U+00c2U+00c3U+00c4U+00c5U+00ffU+003fU+003fU+003fU+003fU+003fU+003f
 U+0041U+0042U+0043U+0044U+0045U+0046U+0047U+00c0U+00c1U+00c2U+00c3U+00c4U+00c5U+00ffU+0100U+3042U+3044U+3046U+3048U+304a
-Test of RepeatedStream
-first stream: 01234567
-second stream: 01234567
-first reader: 01234567
-second reader: 01234567
 Test resultsetStream finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out?rev=355437&r1=355436&r2=355437&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultsetStream.out
Fri Dec  9 02:20:02 2005
@@ -16,9 +16,4 @@
 Test of getAsciiStream
 U+0041U+0042U+0043U+0044U+0045U+0046U+0047U+00c0U+00c1U+00c2U+00c3U+00c4U+00c5U+00ffU+003fU+003fU+003fU+003fU+003fU+003f
 U+0041U+0042U+0043U+0044U+0045U+0046U+0047U+00c0U+00c1U+00c2U+00c3U+00c4U+00c5U+00ffU+0100U+3042U+3044U+3046U+3048U+304a
-Test of RepeatedStream
-first stream: 01234567
-second stream: 01234567
-first reader: 01234567
-second reader: 01234567
 Test resultsetStream finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java?rev=355437&r1=355436&r2=355437&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultsetStream.java
Fri Dec  9 02:20:02 2005
@@ -40,8 +40,6 @@
 import java.util.zip.CRC32;
 import java.io.Reader;
 import java.io.StringReader;
-import java.io.ByteArrayInputStream;
-import java.io.CharArrayReader;
 
 /**
  * Test of JDBC result set Stream calls.
@@ -287,7 +285,6 @@
 			stmt.close();
 			
 			TestOfGetAsciiStream.executeTestOfGetAsciiStream(con);
-			TestOfRepeatedStream.executeTestOfRepeatedStream(con);
 
 			con.close();
 
@@ -471,223 +468,5 @@
 		}
 		
 	}
-    
-    static class TestOfRepeatedStream{
-
-	
-	private static void executeTestOfRepeatedStream(Connection conn) 
-	    throws SQLException, IOException {
-	
-	    System.out.println("Test of RepeatedStream");
-
-	    prepareTestRepeatedStream(conn);
-	    readFromRepeatedStream(conn);
-	    cleanTest(conn);
-	    
-	    prepareTestRepeatedReader(conn);
-	    readFromRepeatedReader(conn);
-	    cleanTest(conn);
-	    
-	}
-    
-    
-	private static void prepareTestRepeatedStream(Connection conn) throws SQLException {
-	
-	    PreparedStatement st = null;
-
-	    try{
-
-		st = conn.prepareStatement("create table testBlobX2 (a integer, b blob(1024K))");
-		st.execute();
-		st.close();
-
-		st = conn.prepareStatement("insert into testBlobX2(a,b) values(1,?)");
-
-		byte[] testData = new byte[1024 * 1024];
-	    
-		for(int i = 0;
-		    i < testData.length;
-		    i ++)
-		    testData[i] = (byte) (i % 256);
-	    
-		st.setBinaryStream(1, 
-				   new ByteArrayInputStream(testData),
-				   testData.length);
-
-		st.executeUpdate();
-
-	    }finally{
-		if(st != null)
-		    st.close();
-	    }
-	
-	}
-
-
-	private static void readFromRepeatedStream(Connection conn) 
-	    throws SQLException ,IOException {
-	
-	    PreparedStatement st = null;
-	    ResultSet rs = null;
-	
-	    InputStream is = null;
-
-	    try{
-		st = conn.prepareStatement("SELECT b FROM testBlobX2 WHERE a = 1");
-		rs = st.executeQuery();
-	    
-		rs.next();
-	    
-		System.out.print("first stream: ");
-		readHeadOfStream(rs);
-	    
-		System.out.print("second stream: ");
-		readHeadOfStream(rs);
-
-	    }finally{
-		if(rs != null)
-		    rs.close();
-	    
-		if(st != null)
-		    st.close();
-	    
-	    }
-
-	}
-
-    
-	private static void readHeadOfStream(ResultSet rs) 
-	    throws SQLException, IOException {
-	
-	    InputStream is = null;
-
-	    try{
-		is = rs.getBinaryStream(1);
-
-		for( int i = 0 ;
-		     i < 8 ;
-		     i ++ ){
-		
-		    System.out.print(is.read());
-		
-		}
-	    
-		System.out.println();
-	    
-	    }finally{
-		if(is != null)
-		    is.close();
-	    }
-	}
-	
-	
-	private static void prepareTestRepeatedReader(Connection conn) throws SQLException {
-	
-	    PreparedStatement st = null;
-
-	    try{
-
-		st = conn.prepareStatement("create table testBlobX2 (a integer, b clob(1024K))");
-		st.execute();
-		st.close();
-
-		st = conn.prepareStatement("insert into testBlobX2(a,b) values(1,?)");
-
-		char[] testData = new char[1024 * 1024];
-	    
-		for(int i = 0;
-		    i < testData.length;
-		    i ++)
-		    testData[i] = (char) (i % Character.MAX_VALUE);
-	    
-		st.setCharacterStream(1, 
-				      new CharArrayReader(testData),
-				      testData.length);
-
-		st.executeUpdate();
-
-	    }finally{
-		if(st != null)
-		    st.close();
-	    }
-	
-	}
-	
-	
-	private static void readFromRepeatedReader(Connection conn) 
-	    throws SQLException ,IOException {
-	
-	    PreparedStatement st = null;
-	    ResultSet rs = null;
-	
-	    InputStream is = null;
-
-	    try{
-		st = conn.prepareStatement("SELECT b FROM testBlobX2 WHERE a = 1");
-		rs = st.executeQuery();
-	    
-		rs.next();
-		
-		System.out.print("first reader: ");
-		readHeadOfReader(rs);
-	    
-		System.out.print("second reader: ");
-		readHeadOfReader(rs);
-		
-	    }finally{
-		if(rs != null)
-		    rs.close();
-	    
-		if(st != null)
-		    st.close();
-	    
-	    }
-
-	}
-	
-	
-	private static void readHeadOfReader(ResultSet rs) 
-	    throws SQLException, IOException {
-	
-	    Reader reader = null;
-
-	    try{
-		reader = rs.getCharacterStream(1);
-
-		for( int i = 0 ;
-		     i < 8 ;
-		     i ++ ){
-		
-		    System.out.print(reader.read());
-		
-		}
-	    
-		System.out.println();
-	    
-	    }finally{
-		if(reader != null)
-		    reader.close();
-	    }
-	}
-	
-	
-	private static void cleanTest(Connection conn) 
-	    throws SQLException {
-	
-	    Statement st = null;
-
-	    try{
-		st = conn.createStatement();
-		st.execute("drop table testBlobX2");
-
-	    }finally{
-		if(st != null)
-		    st.close();
-	    }
-	}
-
-
-    }
-    
 
 }



Mime
View raw message