db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r153569 [1/2] - incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java
Date Sat, 12 Feb 2005 22:37:56 GMT
Author: djd
Date: Sat Feb 12 14:37:56 2005
New Revision: 153569

URL: http://svn.apache.org/viewcvs?view=rev&rev=153569
Log:
Move JDBC 2.0 and JDBC 3.0 methods from EmbedResultSet20 to EmbedResultSet
except for those not in the JSR 169 subset.
EmbedResultSet will support JSR 169.
EmbedResultSet20 will support JDBC 2 and 3.


Modified:
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet20.java

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java?view=diff&r1=153568&r2=153569
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java Sat Feb 12 14:37:56 2005
@@ -2,7 +2,7 @@
 
    Derby - Class org.apache.derby.impl.jdbc.EmbedResultSet
 
-   Copyright 1997, 2004 The Apache Software Foundation or its licensors, as applicable.
+   Copyright 1997, 2005 The Apache Software Foundation or its licensors, as applicable.
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
 import org.apache.derby.iapi.sql.ResultSet;
 import org.apache.derby.iapi.sql.Row;
 import org.apache.derby.iapi.sql.ParameterValueSet;
+import org.apache.derby.iapi.sql.execute.ExecCursorTableReference;
 import org.apache.derby.iapi.sql.execute.ExecRow;
 import org.apache.derby.iapi.sql.execute.NoPutResultSet;
 
@@ -49,6 +50,8 @@
 /* can't import these due to name overlap:
 import java.sql.ResultSet;
 */
+import java.sql.Blob;
+import java.sql.Clob;
 import java.sql.Statement;
 import java.sql.SQLException;
 import java.sql.SQLWarning;
@@ -65,7 +68,10 @@
 
 /**
  * A EmbedResultSet for results from the EmbedStatement family. 
- *
+    <P><B>Supports</B>
+   <UL>
+   <LI> JSR 169
+   </UL>
  * @author ames
  */
 
@@ -135,6 +141,9 @@
 
 	protected final int concurrencyOfThisResultSet;
 
+    private int fetchDirection;
+    private int fetchSize;
+
 	/**
 	 * This class provides the glue between the Cloudscape
 	 * resultset and the JDBC resultset, mapping calls-to-calls.
@@ -1529,22 +1538,1655 @@
 		checkIfClosed("findColumn");
 		return findColumnName(columnName);
 	}
+	
+    /////////////////////////////////////////////////////////////////////////
+    //
+    //      JDBC 2.0        -       New public methods
+    //
+    /////////////////////////////////////////////////////////////////////////
+
+
+	//---------------------------------------------------------------------
+	// Getter's and Setter's
+	//---------------------------------------------------------------------
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Return the Statement that produced the ResultSet.
+	 * 
+	 * @return the Statment that produced the result set, or null if the result
+	 *         was produced some other way.
+	 */
+	public final Statement getStatement()
+    {
+            return stmt;
+    }
+
+	//---------------------------------------------------------------------
+	// Traversal/Positioning
+	//---------------------------------------------------------------------
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Determine if the cursor is before the first row in the result set.
+	 * 
+	 * @return true if before the first row, false otherwise. Returns false when
+	 *         the result set contains no rows.
+	 * @exception SQLException
+	 *                Thrown on error.
+	 */
+	public boolean isBeforeFirst() throws SQLException {
+		return checkRowPosition(ResultSet.ISBEFOREFIRST, "isBeforeFirst");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Determine if the cursor is after the last row in the result set.
+	 * 
+	 * @return true if after the last row, false otherwise. Returns false when
+	 *         the result set contains no rows.
+	 * @exception SQLException
+	 *                Thrown on error.
+	 */
+	public boolean isAfterLast() throws SQLException {
+		return checkRowPosition(ResultSet.ISAFTERLAST, "isAfterLast");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Determine if the cursor is on the first row of the result set.
+	 * 
+	 * @return true if on the first row, false otherwise.
+	 * @exception SQLException
+	 *                Thrown on error.
+	 */
+	public boolean isFirst() throws SQLException {
+		return checkRowPosition(ResultSet.ISFIRST, "isFirst");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Determine if the cursor is on the last row of the result set. Note:
+	 * Calling isLast() may be expensive since the JDBC driver might need to
+	 * fetch ahead one row in order to determine whether the current row is the
+	 * last row in the result set.
+	 * 
+	 * @return true if on the last row, false otherwise.
+	 * @exception SQLException
+	 *                Thrown on error.
+	 */
+	public boolean isLast() throws SQLException {
+		return checkRowPosition(ResultSet.ISLAST, "isLast");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Moves to the front of the result set, just before the first row. Has no
+	 * effect if the result set contains no rows.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or result set type is
+	 *                TYPE_FORWARD_ONLY
+	 */
+	public void beforeFirst() throws SQLException {
+		// beforeFirst is only allowed on scroll cursors
+		checkScrollCursor("beforeFirst()");
+		movePosition(BEFOREFIRST, "beforeFirst");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Moves to the end of the result set, just after the last row. Has no
+	 * effect if the result set contains no rows.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or result set type is
+	 *                TYPE_FORWARD_ONLY.
+	 */
+	public void afterLast() throws SQLException {
+		// afterLast is only allowed on scroll cursors
+		checkScrollCursor("afterLast()");
+		movePosition(AFTERLAST, "afterLast");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Moves to the first row in the result set.
+	 * 
+	 * @return true if on a valid row, false if no rows in the result set.
+	 * @exception SQLException
+	 *                if a database-access error occurs, or result set type is
+	 *                TYPE_FORWARD_ONLY.
+	 */
+	public boolean first() throws SQLException {
+		// first is only allowed on scroll cursors
+		checkScrollCursor("first()");
+		return movePosition(FIRST, "first");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Moves to the last row in the result set.
+	 * 
+	 * @return true if on a valid row, false if no rows in the result set.
+	 * @exception SQLException
+	 *                if a database-access error occurs, or result set type is
+	 *                TYPE_FORWARD_ONLY.
+	 */
+	public boolean last() throws SQLException {
+		// last is only allowed on scroll cursors
+		checkScrollCursor("last()");
+		return movePosition(LAST, "last");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Determine the current row number. The first row is number 1, the second
+	 * number 2, etc.
+	 * 
+	 * @return the current row number, else return 0 if there is no current row
+	 * @exception SQLException
+	 *                if a database-access error occurs.
+	 */
+	public int getRow() throws SQLException {
+		// getRow() is only allowed on scroll cursors
+		checkScrollCursor("getRow()");
+
+		/*
+		 * * We probably needn't bother getting the text of * the underlying
+		 * statement but it is better to be * consistent and we aren't
+		 * particularly worried * about performance of getRow().
+		 */
+		return theResults.getRowNumber();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Move to an absolute row number in the result set.
+	 * 
+	 * <p>
+	 * If row is positive, moves to an absolute row with respect to the
+	 * beginning of the result set. The first row is row 1, the second is row 2,
+	 * etc.
+	 * 
+	 * <p>
+	 * If row is negative, moves to an absolute row position with respect to the
+	 * end of result set. For example, calling absolute(-1) positions the cursor
+	 * on the last row, absolute(-2) indicates the next-to-last row, etc.
+	 * 
+	 * <p>
+	 * An attempt to position the cursor beyond the first/last row in the result
+	 * set, leaves the cursor before/after the first/last row, respectively.
+	 * 
+	 * <p>
+	 * Note: Calling absolute(1) is the same as calling first(). Calling
+	 * absolute(-1) is the same as calling last().
+	 * 
+	 * @return true if on the result set, false if off.
+	 * @exception SQLException
+	 *                if a database-access error occurs, or row is 0, or result
+	 *                set type is TYPE_FORWARD_ONLY.
+	 */
+	public boolean absolute(int row) throws SQLException {
+		// absolute is only allowed on scroll cursors
+		checkScrollCursor("absolute()");
+		return movePosition(ABSOLUTE, row, "absolute");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Moves a relative number of rows, either positive or negative. Attempting
+	 * to move beyond the first/last row in the result set positions the cursor
+	 * before/after the the first/last row. Calling relative(0) is valid, but
+	 * does not change the cursor position.
+	 * 
+	 * <p>
+	 * Note: Calling relative(1) is different than calling next() since is makes
+	 * sense to call next() when there is no current row, for example, when the
+	 * cursor is positioned before the first row or after the last row of the
+	 * result set.
+	 * 
+	 * @return true if on a row, false otherwise.
+	 * @exception SQLException
+	 *                if a database-access error occurs, or there is no current
+	 *                row, or result set type is TYPE_FORWARD_ONLY.
+	 */
+	public boolean relative(int row) throws SQLException {
+		// absolute is only allowed on scroll cursors
+		checkScrollCursor("relative()");
+		return movePosition(RELATIVE, row, "relative");
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * <p>
+	 * Moves to the previous row in the result set.
+	 * 
+	 * <p>
+	 * Note: previous() is not the same as relative(-1) since it makes sense to
+	 * call previous() when there is no current row.
+	 * 
+	 * @return true if on a valid row, false if off the result set.
+	 * @exception SQLException
+	 *                if a database-access error occurs, or result set type is
+	 *                TYPE_FORWAR_DONLY.
+	 */
+	public boolean previous() throws SQLException {
+		// previous is only allowed on scroll cursors
+		checkScrollCursor("previous()");
+		return movePosition(PREVIOUS, "previous");
+	}
+
+	//---------------------------------------------------------------------
+	// Properties
+	//---------------------------------------------------------------------
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Give a hint as to the direction in which the rows in this result set will
+	 * be processed. The initial value is determined by the statement that
+	 * produced the result set. The fetch direction may be changed at any time.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or the result set type
+	 *                is TYPE_FORWARD_ONLY and direction is not FETCH_FORWARD.
+	 */
+	public void setFetchDirection(int direction) throws SQLException {
+		checkScrollCursor("setFetchDirection()");
+		/*
+		 * FetchDirection is meaningless to us. We just save it off and return
+		 * the current value if asked.
+		 */
+		fetchDirection = direction;
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Return the fetch direction for this result set.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public int getFetchDirection() throws SQLException {
+		if (fetchDirection == 0) {
+			// value is not set at the result set level
+			// get it from the statement level
+			return stmt.getFetchDirection();
+		} else
+			return fetchDirection;
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Give the JDBC driver a hint as to the number of rows that should be
+	 * fetched from the database when more rows are needed for this result set.
+	 * If the fetch size specified is zero, then the JDBC driver ignores the
+	 * value, and is free to make its own best guess as to what the fetch size
+	 * should be. The default value is set by the statement that creates the
+	 * result set. The fetch size may be changed at any time.
+	 * 
+	 * @param rows
+	 *            the number of rows to fetch
+	 * @exception SQLException
+	 *                if a database-access error occurs, or the condition 0 <=
+	 *                rows <= this.getMaxRows() is not satisfied.
+	 */
+	public void setFetchSize(int rows) throws SQLException {
+		if (rows < 0 || (stmt.getMaxRows() != 0 && rows > stmt.getMaxRows())) {
+			throw Util.generateCsSQLException(SQLState.INVALID_FETCH_SIZE,
+					new Integer(rows));
+		} else if (rows > 0) // if it is zero ignore the call
+		{
+			fetchSize = rows;
+		}
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Return the fetch size for this result set.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public int getFetchSize() throws SQLException {
+		if (fetchSize == 0) {
+			// value is not set at the result set level
+			//  get the default value from the statement
+			return stmt.getFetchSize();
+		} else
+			return fetchSize;
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Return the type of this result set. The type is determined based on the
+	 * statement that created the result set.
+	 * 
+	 * @return TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, or
+	 *         TYPE_SCROLL_SENSITIVE
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public int getType() throws SQLException {
+		return stmt.getResultSetType();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Return the concurrency of this result set. The concurrency is determined
+	 * as follows If Statement object has CONCUR_READ_ONLY concurrency, then
+	 * ResultSet object will also have the CONCUR_READ_ONLY concurrency. But if
+	 * Statement object has CONCUR_UPDATABLE concurrency, then the concurrency
+	 * of ResultSet object depends on whether the underlying language resultset
+	 * is updatable or not. If the language resultset is updatable, then JDBC
+	 * ResultSet object will also have the CONCUR_UPDATABLE concurrency. If
+	 * lanugage resultset is not updatable, then JDBC ResultSet object
+	 * concurrency will be set to CONCUR_READ_ONLY.
+	 * 
+	 * @return the concurrency type, CONCUR_READ_ONLY, etc.
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public int getConcurrency() throws SQLException {
+		return concurrencyOfThisResultSet;
+	}
+
+    //---------------------------------------------------------------------
+	// Updates
+	//---------------------------------------------------------------------
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Determine if the current row has been updated. The value returned depends
+	 * on whether or not the result set can detect updates.
+	 * 
+	 * @return true if the row has been visibly updated by the owner or another,
+	 *         and updates are detected
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 * 
+	 * @see EmbedDatabaseMetaData#updatesAreDetected
+	 */
+	public boolean rowUpdated() throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Determine if the current row has been inserted. The value returned
+	 * depends on whether or not the result set can detect visible inserts.
+	 * 
+	 * @return true if inserted and inserts are detected
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 * 
+	 * @see EmbedDatabaseMetaData#insertsAreDetected
+	 */
+	public boolean rowInserted() throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Determine if this row has been deleted. A deleted row may leave a visible
+	 * "hole" in a result set. This method can be used to detect holes in a
+	 * result set. The value returned depends on whether or not the result set
+	 * can detect deletions.
+	 * 
+	 * @return true if deleted and deletes are detected
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 * 
+	 * @see EmbedDatabaseMetaData#deletesAreDetected
+	 */
+	public boolean rowDeleted() throws SQLException {
+		return false;
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Give a nullable column a null value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateNull(int columnIndex) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a boolean value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateBoolean(int columnIndex, boolean x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a byte value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateByte(int columnIndex, byte x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a short value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateShort(int columnIndex, short x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an integer value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateInt(int columnIndex, int x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a long value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateLong(int columnIndex, long x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a float value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateFloat(int columnIndex, float x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a Double value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateDouble(int columnIndex, double x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a String value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateString(int columnIndex, String x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a byte array value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateBytes(int columnIndex, byte x[]) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a Date value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateDate(int columnIndex, java.sql.Date x)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a Time value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateTime(int columnIndex, java.sql.Time x)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a Timestamp value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateTimestamp(int columnIndex, java.sql.Timestamp x)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an ascii stream value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @param length
+	 *            the length of the stream
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateAsciiStream(int columnIndex, java.io.InputStream x,
+			int length) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a binary stream value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @param length
+	 *            the length of the stream
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateBinaryStream(int columnIndex, java.io.InputStream x,
+			int length) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a character stream value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @param length
+	 *            the length of the stream
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateCharacterStream(int columnIndex, java.io.Reader x,
+			int length) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an Object value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @param scale
+	 *            For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
+	 *            this is the number of digits after the decimal. For all other
+	 *            types this value will be ignored.
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateObject(int columnIndex, Object x, int scale)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an Object value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnIndex
+	 *            the first column is 1, the second is 2, ...
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateObject(int columnIndex, Object x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a null value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateNull(String columnName) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a boolean value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateBoolean(String columnName, boolean x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a byte value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateByte(String columnName, byte x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a short value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateShort(String columnName, short x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an integer value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateInt(String columnName, int x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a long value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateLong(String columnName, long x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a float value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateFloat(String columnName, float x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a double value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateDouble(String columnName, double x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a String value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateString(String columnName, String x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a byte array value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateBytes(String columnName, byte x[]) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a Date value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateDate(String columnName, java.sql.Date x)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a Time value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateTime(String columnName, java.sql.Time x)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a Timestamp value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateTimestamp(String columnName, java.sql.Timestamp x)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an ascii stream value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @param length
+	 *            of the stream
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateAsciiStream(String columnName, java.io.InputStream x,
+			int length) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a binary stream value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @param length
+	 *            of the stream
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateBinaryStream(String columnName, java.io.InputStream x,
+			int length) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with a character stream value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @param length
+	 *            of the stream
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateCharacterStream(String columnName, java.io.Reader reader,
+			int length) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an Object value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @param scale
+	 *            For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
+	 *            this is the number of digits after the decimal. For all other
+	 *            types this value will be ignored.
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateObject(String columnName, Object x, int scale)
+			throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update a column with an Object value.
+	 * 
+	 * The updateXXX() methods are used to update column values in the current
+	 * row, or the insert row. The updateXXX() methods do not update the
+	 * underlying database, instead the updateRow() or insertRow() methods are
+	 * called to update the database.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param x
+	 *            the new column value
+	 * @exception SQLException
+	 *                if a database-access error occurs
+	 */
+	public void updateObject(String columnName, Object x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Insert the contents of the insert row into the result set and the
+	 * database. Must be on the insert row when this method is called.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, if called when not on
+	 *                the insert row, or if all non-nullable columns in the
+	 *                insert row have not been given a value
+	 */
+	public void insertRow() throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Update the underlying database with the new contents of the current row.
+	 * Cannot be called when on the insert row.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or if called when on
+	 *                the insert row
+	 */
+	public void updateRow() throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Delete the current row from the result set and the underlying database.
+	 * Cannot be called when on the insert row.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or if called when on
+	 *                the insert row.
+	 */
+	public void deleteRow() throws SQLException {
+		synchronized (getConnectionSynchronization()) {
+			checkIfClosed("deleteRow");
+			checkOnRow(); // first make sure there's a current row
+
+			if (getConcurrency() != JDBC20Translation.CONCUR_UPDATABLE)//if not
+																	   // updatable
+																	   // resultset,
+																	   // can't
+																	   // issue
+																	   // deleteRow
+				throw Util.generateCsSQLException(
+						SQLState.UPDATABLE_RESULTSET_API_DISALLOWED,
+						"deleteRow");
+
+			setupContextStack();
+			try {
+				//in case of autocommit on, if there was an exception which
+				// caused runtime rollback in this transaction prior to this
+				// deleteRow,
+				//the rollback code will mark the language resultset closed (it
+				// doesn't mark the JDBC ResultSet closed).
+				//That is why alongwith the earlier checkIfClosed call in this
+				// method, there is a check for language resultset close as
+				// well.
+				if (theResults.isClosed())
+					throw Util.generateCsSQLException(
+							SQLState.LANG_RESULT_SET_NOT_OPEN, "deleteRow");
+				StringBuffer deleteWhereCurrentOfSQL = new StringBuffer(
+						"DELETE FROM ");
+				Activation activation = getEmbedConnection()
+						.getLanguageConnection().lookupCursorActivation(
+								getCursorName());
+				deleteWhereCurrentOfSQL.append(getFullBaseTableName(activation
+						.getPreparedStatement().getTargetTable()));//get the
+																   // underlying
+																   // (schema.)table
+																   // name
+				//using quotes around the cursor name to preserve case
+				// sensitivity
+				deleteWhereCurrentOfSQL.append(" WHERE CURRENT OF \""
+						+ getCursorName() + "\"");
+
+				LanguageConnectionContext lcc = getEmbedConnection()
+						.getLanguageConnection();
+				StatementContext statementContext = lcc.pushStatementContext(
+						isAtomic, deleteWhereCurrentOfSQL.toString(), null,
+						false);
+				org.apache.derby.iapi.sql.PreparedStatement ps = lcc
+						.prepareInternalStatement(deleteWhereCurrentOfSQL
+								.toString());
+				org.apache.derby.iapi.sql.ResultSet rs = ps.execute(lcc, true);
+				rs.close();
+				rs.finish();
+				//For forward only resultsets, after a delete, the ResultSet
+				// will be positioned right before the next row.
+				rowData = null;
+				lcc.popStatementContext(statementContext, null);
+			} catch (StandardException t) {
+				throw closeOnTransactionError(t);
+			} finally {
+				restoreContextStack();
+			}
+		}
+	}
+
+	private String getFullBaseTableName(ExecCursorTableReference targetTable) {
+		if (targetTable.getSchemaName() != null)
+			return targetTable.getSchemaName() + "."
+					+ targetTable.getBaseName();
+		else
+			return targetTable.getBaseName();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Refresh the value of the current row with its current value in the
+	 * database. Cannot be called when on the insert row.
+	 * 
+	 * The refreshRow() method provides a way for an application to explicitly
+	 * tell the JDBC driver to refetch a row(s) from the database. An
+	 * application may want to call refreshRow() when caching or prefetching is
+	 * being done by the JDBC driver to fetch the latest value of a row from the
+	 * database. The JDBC driver may actually refresh multiple rows at once if
+	 * the fetch size is greater than one.
+	 * 
+	 * All values are refetched subject to the transaction isolation level and
+	 * cursor sensitivity. If refreshRow() is called after calling updateXXX(),
+	 * but before calling updateRow() then the updates made to the row are lost.
+	 * Calling refreshRow() frequently will likely slow performance.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or if called when on
+	 *                the insert row.
+	 */
+	public void refreshRow() throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * The cancelRowUpdates() method may be called after calling an updateXXX()
+	 * method(s) and before calling updateRow() to rollback the updates made to
+	 * a row. If no updates have been made or updateRow() has already been
+	 * called, then this method has no effect.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or if called when on
+	 *                the insert row.
+	 *  
+	 */
+	public void cancelRowUpdates() throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Move to the insert row. The current cursor position is remembered while
+	 * the cursor is positioned on the insert row.
+	 * 
+	 * The insert row is a special row associated with an updatable result set.
+	 * It is essentially a buffer where a new row may be constructed by calling
+	 * the updateXXX() methods prior to inserting the row into the result set.
+	 * 
+	 * Only the updateXXX(), getXXX(), and insertRow() methods may be called
+	 * when the cursor is on the insert row. All of the columns in a result set
+	 * must be given a value each time this method is called before calling
+	 * insertRow(). UpdateXXX()must be called before getXXX() on a column.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or the result set is
+	 *                not updatable
+	 */
+	public void moveToInsertRow() throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Move the cursor to the remembered cursor position, usually the current
+	 * row. Has no effect unless the cursor is on the insert row.
+	 * 
+	 * @exception SQLException
+	 *                if a database-access error occurs, or the result set is
+	 *                not updatable
+	 */
+	public void moveToCurrentRow() throws SQLException {
+		throw Util.notImplemented();
+	}
 
     /**
-     * Map a Resultset column name to a ResultSet column index.
-     *
-     * @param columnName the name of the column
-	 * @param operation		the operation the caller is trying to do
-	 *						(for error reporting).  Null means don't do error
-	 *						checking.
-     * @return the column index
-	 * @exception SQLException thrown on failure.
-     */
+	 * JDBC 2.0
+	 * 
+	 * Get a BLOB column.
+	 * 
+	 * @param i
+	 *            the first column is 1, the second is 2, ...
+	 * @return an object representing a BLOB
+	 */
+	public Blob getBlob(int columnIndex) throws SQLException {
+
+		closeCurrentStream(); // closing currentStream does not depend on the
+		// underlying connection. Do this outside of
+		// the connection synchronization.
+
+		checkIfClosed("getBlob"); // checking result set closure does not depend
+		// on the underlying connection. Do this
+		// outside of the connection synchronization.
+
+		synchronized (getConnectionSynchronization()) {
+			int colType = getColumnType(columnIndex);
+
+			// DB2, only allow getBlob on a BLOB column.
+			if (colType != Types.BLOB)
+				throw dataTypeConversion("java.sql.Blob", columnIndex);
+
+			boolean pushStack = false;
+			try {
+				DataValueDescriptor dvd = currentRow.getColumn(columnIndex);
+
+				if (wasNull = dvd.isNull())
+					return null;
+
+				// should set up a context stack if we have a long column,
+				// since a blob may keep a pointer to a long column in the
+				// database
+				if (dvd.getStream() != null)
+					pushStack = true;
+
+				if (pushStack)
+					setupContextStack();
+
+				return new EmbedBlob(dvd, getEmbedConnection());
+			} catch (Throwable t) {
+				throw handleException(t);
+			} finally {
+				if (pushStack)
+					restoreContextStack();
+			}
+		}
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Get a CLOB column.
+	 * 
+	 * @param i
+	 *            the first column is 1, the second is 2, ...
+	 * @return an object representing a CLOB
+	 */
+	public final Clob getClob(int columnIndex) throws SQLException {
+
+		closeCurrentStream(); // closing currentStream does not depend on the
+		// underlying connection. Do this outside of
+		// the connection synchronization.
+
+		checkIfClosed("getClob"); // checking result set closure does not depend
+		// on the underlying connection. Do this
+		// outside of the connection synchronization.
+
+		synchronized (getConnectionSynchronization()) {
+			int colType = getColumnType(columnIndex);
+
+			// DB2:, only allow getClob on a CLOB column.
+			if (colType != Types.CLOB)
+				throw dataTypeConversion("java.sql.Clob", columnIndex);
+
+			boolean pushStack = false;
+			try {
+
+				DataValueDescriptor dvd = currentRow.getColumn(columnIndex);
+
+				if (wasNull = dvd.isNull())
+					return null;
+
+				// should set up a context stack if we have a long column,
+				// since a blob may keep a pointer to a long column in the
+				// database
+				if (dvd.getStream() != null)
+					pushStack = true;
+
+				if (pushStack)
+					setupContextStack();
+
+				return new EmbedClob(dvd, getEmbedConnection());
+			} catch (Throwable t) {
+				throw handleException(t);
+			} finally {
+				if (pushStack)
+					restoreContextStack();
+			}
+		}
+	}
+	
+    /**
+	 * JDBC 2.0
+	 * 
+	 * Get a BLOB column.
+	 * 
+	 * @param colName
+	 *            the column name
+	 * @return an object representing a BLOB
+	 */
+	public final Blob getBlob(String columnName) throws SQLException {
+		return (getBlob(findColumnName(columnName)));
+	}
+
+	/**
+	 * JDBC 2.0
+	 * 
+	 * Get a CLOB column.
+	 * 
+	 * @param colName
+	 *            the column name
+	 * @return an object representing a CLOB
+	 * @exception SQLException
+	 *                Feature not implemented for now.
+	 */
+	public final Clob getClob(String columnName) throws SQLException {
+		return (getClob(findColumnName(columnName)));
+	}	
+
+	
+    /**
+	 * JDBC 3.0
+	 * 
+	 * Updates the designated column with a java.sql.Blob value. The updater
+	 * methods are used to update column values in the current row or the insert
+	 * row. The updater methods do not update the underlying database; instead
+	 * the updateRow or insertRow methods are called to update the database.
+	 * 
+	 * @param columnIndex -
+	 *            the first column is 1, the second is 2
+	 * @param x -
+	 *            the new column value
+	 * @exception SQLException
+	 *                Feature not implemented for now.
+	 */
+	public void updateBlob(int columnIndex, Blob x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 3.0
+	 * 
+	 * Updates the designated column with a java.sql.Blob value. The updater
+	 * methods are used to update column values in the current row or the insert
+	 * row. The updater methods do not update the underlying database; instead
+	 * the updateRow or insertRow methods are called to update the database.
+	 * 
+	 * @param columnName -
+	 *            the SQL name of the column
+	 * @param x -
+	 *            the new column value
+	 * @exception SQLException
+	 *                Feature not implemented for now.
+	 */
+	public void updateBlob(String columnName, Blob x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 3.0
+	 * 
+	 * Updates the designated column with a java.sql.Clob value. The updater
+	 * methods are used to update column values in the current row or the insert
+	 * row. The updater methods do not update the underlying database; instead
+	 * the updateRow or insertRow methods are called to update the database.
+	 * 
+	 * @param columnIndex -
+	 *            the first column is 1, the second is 2
+	 * @param x -
+	 *            the new column value
+	 * @exception SQLException
+	 *                Feature not implemented for now.
+	 */
+	public void updateClob(int columnIndex, Clob x) throws SQLException {
+		throw Util.notImplemented();
+	}
+
+	/**
+	 * JDBC 3.0
+	 * 
+	 * Updates the designated column with a java.sql.Clob value. The updater
+	 * methods are used to update column values in the current row or the insert
+	 * row. The updater methods do not update the underlying database; instead
+	 * the updateRow or insertRow methods are called to update the database.
+	 * 
+	 * @param columnName -
+	 *            the SQL name of the column
+	 * @param x -
+	 *            the new column value
+	 * @exception SQLException
+	 *                Feature not implemented for now.
+	 */
+	public void updateClob(String columnName, Clob x) throws SQLException {
+		throw Util.notImplemented();
+	}
+	
+	
+	/*
+	 * * End of JDBC public methods.
+	 */
+
+    /**
+	 * Map a Resultset column name to a ResultSet column index.
+	 * 
+	 * @param columnName
+	 *            the name of the column
+	 * @param operation
+	 *            the operation the caller is trying to do (for error
+	 *            reporting). Null means don't do error checking.
+	 * @return the column index
+	 * @exception SQLException
+	 *                thrown on failure.
+	 */
     protected int findColumnName(String columnName)
 						throws SQLException {
 		// n.b. if we went through the JDBC interface,
 		// there is a caching implementation in the JDBC doc
-		// (appendix C).  But we go through our own info, for now.
+		// (appendix C). But we go through our own info, for now.
 		// REVISIT: we might want to cache our own info...
 		
 
@@ -1575,9 +3217,9 @@
 	}
 
 	/**
-		Documented behaviour for streams is that they are implicitly closed
-		on the next get*() method call.
-	*/
+	 * Documented behaviour for streams is that they are implicitly closed on
+	 * the next get*() method call.
+	 */
 	protected final void closeCurrentStream() {
 
 		if (currentStream != null) {
@@ -1756,10 +3398,66 @@
 		return order - olrs.order;
 
 	}
+	
+    private void checkScrollCursor(String methodName) throws SQLException {
+
+		if (stmt.getResultSetType() == JDBC20Translation.TYPE_FORWARD_ONLY)
+			throw Util
+					.newEmbedSQLException(
+							SQLState.NOT_ON_FORWARD_ONLY_CURSOR,
+							new Object[] { methodName },
+							StandardException
+									.getSeverityFromIdentifier(SQLState.NOT_ON_FORWARD_ONLY_CURSOR));
+	}
+	private boolean checkRowPosition(int position, String positionText)
+			throws SQLException {
+		// beforeFirst is only allowed on scroll cursors
+		checkScrollCursor(positionText);
+
+		checkIfClosed(positionText); // checking result set closure does not
+									 // depend
+		// on the underlying connection. Do this
+		// outside of the connection synchronization.
+
+		synchronized (getConnectionSynchronization()) {
+			setupContextStack();
+			try {
+				try {
 
+					/*
+					 * Push and pop a StatementContext around a next call so
+					 * that the ResultSet will get correctly closed down on an
+					 * error. (Cache the LanguageConnectionContext)
+					 */
+					LanguageConnectionContext lcc = getEmbedConnection()
+							.getLanguageConnection();
+					StatementContext statementContext = lcc
+							.pushStatementContext(isAtomic, getSQLText(),
+									getParameterValueSet(), false);
+
+					boolean result = theResults.checkRowPosition(position);
+
+					lcc.popStatementContext(statementContext, null);
+
+					return result;
+
+				} catch (Throwable t) {
+					/*
+					 * Need to close the result set here because the error might
+					 * cause us to lose the current connection if this is an XA
+					 * connection and we won't be able to do the close later
+					 */
+					throw closeOnTransactionError(t);
+				}
+
+			} finally {
+				restoreContextStack();
+			}
+		}
+	}
 	/**
-	**  Is this result set from a select for update statement?
-	*/
+	 * * Is this result set from a select for update statement?
+	 */
 	public final boolean isForUpdate()
 	{
 		if (theResults instanceof NoPutResultSet)



Mime
View raw message