"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "hsqldb/src/org/hsqldb/jdbc/JDBCClobFile.java" between
hsqldb-2.7.0.zip and hsqldb-2.7.1.zip

About: HSQLDB (HyperSQL DataBase) is a SQL relational database engine written in Java. It supports nearly full ANSI-92 SQL (BNF format) and full core SQL:2008.

JDBCClobFile.java  (hsqldb-2.7.0):JDBCClobFile.java  (hsqldb-2.7.1)
skipping to change at line 93 skipping to change at line 93
* <b>Design Notes</b><p> * <b>Design Notes</b><p>
* *
* Although it is possible to implement a transactional version of this class, * Although it is possible to implement a transactional version of this class,
* the present implementation directly propagates changes to the underlying * the present implementation directly propagates changes to the underlying
* file such that changes become visible as soon as they are either * file such that changes become visible as soon as they are either
* implicitly or explicitly flushed to disk. * implicitly or explicitly flushed to disk.
* *
* </div> * </div>
* <!-- end release-specific documentation --> * <!-- end release-specific documentation -->
* @author Campbell Burnet (campbell-burnet@users dot sourceforge.net) * @author Campbell Burnet (campbell-burnet@users dot sourceforge.net)
* @version 2.5.0 * @version 2.7.1
* @since HSQLDB 2.1 * @since HSQLDB 2.1
*/ */
public class JDBCClobFile implements java.sql.Clob { public class JDBCClobFile implements java.sql.Clob {
private static final FrameworkLogger LOG = private static final FrameworkLogger LOG =
FrameworkLogger.getLog(JDBCClobFile.class); FrameworkLogger.getLog(JDBCClobFile.class);
/** /**
* Retrieves the number of characters * Retrieves the number of characters
* in the <code>CLOB</code> value * in the <code>CLOB</code> value
skipping to change at line 214 skipping to change at line 214
* <code>CLOB</code> value * <code>CLOB</code> value
* @exception java.sql.SQLFeatureNotSupportedException if the JDBC driver do es not support * @exception java.sql.SQLFeatureNotSupportedException if the JDBC driver do es not support
* this method * this method
* @see #setAsciiStream * @see #setAsciiStream
* @since JDK 1.2 * @since JDK 1.2
*/ */
public InputStream getAsciiStream() throws SQLException { public InputStream getAsciiStream() throws SQLException {
InputStream stream; InputStream stream;
final List streams = m_streams;
try { try {
stream = new JDBCBlobFile.InputStreamAdapter(m_file, 0, stream = new JDBCBlobFile.InputStreamAdapter(m_file, 0,
Long.MAX_VALUE) { Long.MAX_VALUE) {
private boolean closed; private boolean closed;
private InputStream self = this;
public synchronized void close() throws IOException { public synchronized void close() throws IOException {
if (closed) { if (closed) {
return; return;
} }
closed = true; closed = true;
try { try {
super.close(); super.close();
} finally { } finally {
m_streams.remove(this); streams.remove(self);
} }
} }
}; };
} catch (FileNotFoundException ex) { } catch (FileNotFoundException ex) {
throw JDBCUtil.sqlException(ex); throw JDBCUtil.sqlException(ex);
} catch (IOException ex) { } catch (IOException ex) {
throw JDBCUtil.sqlException(ex); throw JDBCUtil.sqlException(ex);
} catch (SecurityException ex) { } catch (SecurityException ex) {
throw JDBCUtil.sqlException(ex); throw JDBCUtil.sqlException(ex);
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
throw JDBCUtil.sqlException(ex); throw JDBCUtil.sqlException(ex);
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
throw JDBCUtil.sqlException(ex); throw JDBCUtil.sqlException(ex);
} }
m_streams.add(stream); streams.add(stream);
return stream; return stream;
} }
/** /**
* Retrieves the character position at which the specified char[] * Retrieves the character position at which the specified char[]
* <code>pattern</code> appears in the <code>CLOB</code> value * <code>pattern</code> appears in the <code>CLOB</code> value
* represented by this <code>Clob</code> object. The search * represented by this <code>Clob</code> object. The search
* begins at position <code>start</code>. * begins at position <code>start</code>.
* *
skipping to change at line 873 skipping to change at line 877
if (pos < 1) { if (pos < 1) {
throw JDBCUtil.outOfRangeArgument("pos: " + pos); throw JDBCUtil.outOfRangeArgument("pos: " + pos);
} }
if (length < 0) { if (length < 0) {
throw JDBCUtil.outOfRangeArgument("length: " + length); throw JDBCUtil.outOfRangeArgument("length: " + length);
} }
Reader reader; Reader reader;
final List streams = m_streams;
try { try {
reader = new ReaderAdapter(m_file, pos - 1, length) { reader = new ReaderAdapter(m_file, pos - 1, length) {
public void close() throws IOException { public void close() throws IOException {
try { try {
super.close(); super.close();
} finally { } finally {
m_streams.remove(this); streams.remove(this);
} }
} }
}; };
} catch (IOException ex) { } catch (IOException ex) {
throw JDBCUtil.sqlException(ex); throw JDBCUtil.sqlException(ex);
} catch (Throwable ex) { } catch (Throwable ex) {
throw JDBCUtil.sqlException(ex); throw JDBCUtil.sqlException(ex);
} }
m_streams.add(reader); streams.add(reader);
return reader; return reader;
} }
/** /**
* Retrieves the canonical <code>File</code> object denoting the file that * Retrieves the canonical <code>File</code> object denoting the file that
* backs this CLOB. * backs this CLOB.
* *
* @return the file that backs this CLOB. * @return the file that backs this CLOB.
*/ */
 End of changes. 8 change blocks. 
5 lines changed or deleted 11 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)