Author: shawkins
Date: 2011-11-08 14:02:22 -0500 (Tue, 08 Nov 2011)
New Revision: 3620
Modified:
trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
Log:
removing possibly out of date javadocs and updating the javadoc for
ExecutionContext.addWarning
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-11-08 17:48:30
UTC (rev 3619)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionContext.java 2011-11-08 19:02:22
UTC (rev 3620)
@@ -23,6 +23,7 @@
package org.teiid.translator;
import java.io.Serializable;
+import java.sql.Statement;
import javax.security.auth.Subject;
@@ -130,7 +131,9 @@
int getBatchSize();
/**
- * Add an exception as a warning to this Execution.
+ * Add an exception as a warning to this Execution. If the exception is not an
instance of a SQLWarning
+ * it will be wrapped by a SQLWarning for the client. The warnings can be consumed
through the
+ * {@link Statement#getWarnings()} method.
* @param ex
*/
void addWarning(Exception ex);
Modified: trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-11-08
17:48:30 UTC (rev 3619)
+++ trunk/client/src/main/java/org/teiid/jdbc/PreparedStatementImpl.java 2011-11-08
19:02:22 UTC (rev 3620)
@@ -286,13 +286,6 @@
setAsciiStream(parameterIndex, in);
}
- /**
- * <p>Sets the IN parameter at paramaterIndex to a BigDecimal object. The
parameter
- * type is set to NUMERIC
- * @param parameterIndex of the parameter whose value is to be set
- * @param BigDecimal object to which the parameter value is to be set.
- * @throws SQLException, should not occur
- */
public void setBigDecimal (int parameterIndex, java.math.BigDecimal value) throws
SQLException {
setObject(parameterIndex, value);
}
@@ -301,43 +294,18 @@
setBlob(parameterIndex, in);
}
- /**
- * <p>Sets the parameter in position parameterIndex to a Blob object.
- * @param parameterIndex of the parameter whose value is to be set
- * @param Blob object to which the parameter value is to be set.
- * @throws SQLException if parameter type/datatype do not match
- */
public void setBlob (int parameterIndex, Blob x) throws SQLException {
setObject(parameterIndex, x);
}
- /**
- * <p>Sets parameter number parameterIndex to b, a Java boolean value. The
parameter
- * type is set to BIT
- * @param parameterIndex of the parameter whose value is to be set
- * @param boolean value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setBoolean (int parameterIndex, boolean value) throws SQLException {
setObject(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a Java byte value. The
parameter
- * type is set to TINYINT
- * @param parameterIndex of the parameter whose value is to be set
- * @param byte value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setByte(int parameterIndex, byte value) throws SQLException {
setObject(parameterIndex, Byte.valueOf(value));
}
- /**
- * <p>Sets parameter number parameterIndex to x[], a Java array of bytes.
- * @param parameterIndex of the parameter whose value is to be set
- * @param bytes array to which the parameter value is to be set.
- */
public void setBytes(int parameterIndex, byte bytes[]) throws SQLException {
setObject(parameterIndex, new SerialBlob(bytes));
}
@@ -346,35 +314,14 @@
setCharacterStream(parameterIndex, reader);
}
- /**
- * <p>Sets the parameter in position parameterIndex to a Clob object.
- * @param parameterIndex of the parameter whose value is to be set
- * @param Clob object to which the parameter value is to be set.
- * @throws SQLException if parameter type/datatype do not match.
- */
public void setClob (int parameterIndex, Clob x) throws SQLException {
setObject(parameterIndex, x);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Date object. The
parameter
- * type is set to DATE
- * @param parameterIndex of the parameter whose value is to be set
- * @param Date object to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setDate(int parameterIndex, java.sql.Date value) throws SQLException {
setDate(parameterIndex, value, null);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Date object. The
parameter
- * type is set to DATE
- * @param parameterIndex of the parameter whose value is to be set
- * @param Date object to which the parameter value is to be set.
- * @param Calendar object to constrct date(useful to get include timezone info)
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setDate(int parameterIndex, java.sql.Date x ,java.util.Calendar cal)
throws SQLException {
if (cal == null || x == null) {
@@ -386,79 +333,30 @@
setObject(parameterIndex, TimestampWithTimezone.createDate(x, cal.getTimeZone(),
getDefaultCalendar()));
}
- /**
- * <p>Sets parameter number parameterIndex to x, a double value. The parameter
- * type is set to DOUBLE
- * @param parameterIndex of the parameter whose value is to be set
- * @param double value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setDouble(int parameterIndex, double value) throws SQLException {
setObject(parameterIndex, new Double(value));
}
- /**
- * <p>Sets parameter number parameterIndex to value, a float value. The
parameter
- * type is set to FLOAT
- * @param parameterIndex of the parameter whose value is to be set
- * @param float value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setFloat(int parameterIndex, float value) throws SQLException {
setObject(parameterIndex, new Float(value));
}
- /**
- * <p>Sets parameter number parameterIndex to value, a int value. The
parameter
- * type is set to INTEGER
- * @param parameterIndex of the parameter whose value is to be set
- * @param int value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setInt(int parameterIndex, int value) throws SQLException {
setObject(parameterIndex, Integer.valueOf(value));
}
- /**
- * <p>Sets parameter number parameterIndex to x, a long value. The parameter
- * type is set to BIGINT
- * @param parameterIndex of the parameter whose value is to be set
- * @param long value to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setLong(int parameterIndex, long value) throws SQLException {
setObject(parameterIndex, Long.valueOf(value));
}
- /**
- * <p>Sets parameter number parameterIndex to a null value.
- * @param parameterIndex of the parameter whose value is to be set
- * @param jdbc type of the parameter whose value is to be set to null
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setNull(int parameterIndex, int jdbcType) throws SQLException {
setObject(parameterIndex, null);
}
- /**
- * <p>Sets parameter number parameterIndex to a null value.
- * @param parameterIndex of the parameter whose value is to be set
- * @param jdbc type of the parameter whose value is to be set to null
- * @param fully qualifies typename of the parameter being set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setNull(int parameterIndex, int jdbcType, String typeName) throws
SQLException {
setObject(parameterIndex, null);
}
- /**
- * <p>Sets parameter number parameterIndex to an object value
- * @param parameterIndex of the parameter whose value is to be set
- * @param an object value to which the parameter value is to be set.
- * @param int value giving the JDBC type to conver the object to
- * @param int value giving the scale to be set if the type is DECIMAL or NUMERIC
- * @throws SQLException, if there is an error setting the parameter value
- */
public void setObject (int parameterIndex, Object value, int targetJdbcType, int
scale) throws SQLException {
if(value == null) {
@@ -527,12 +425,6 @@
setObject(parameterIndex, targetObject);
}
- /**
- * <p>Sets parameter number parameterIndex to an object value
- * @param parameterIndex of the parameter whose value is to be set
- * @param an object value to which the parameter value is to be set.
- * @throws SQLException, if there is an error setting the parameter value
- */
public void setObject(int parameterIndex, Object value) throws SQLException {
ArgCheck.isPositive(parameterIndex,
JDBCPlugin.Util.getString("MMPreparedStatement.Invalid_param_index"));
//$NON-NLS-1$
@@ -546,47 +438,18 @@
parameterMap.put(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a short value. The parameter
- * type is set to TINYINT
- * @param parameterIndex of the parameter whose value is to be set
- * @param short value to which the parameter value is to be set.
- * @throws SQLException, if there is an error setting the parameter value
- */
public void setShort(int parameterIndex, short value) throws SQLException {
setObject(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a String value. The parameter
- * type is set to VARCHAR
- * @param parameterIndex of the parameter whose value is to be set
- * @param String object to which the parameter value is to be set.
- * @throws SQLException
- */
public void setString(int parameterIndex, String value) throws SQLException {
setObject(parameterIndex, value);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Time object. The
parameter
- * type is set to TIME
- * @param parameterIndex of the parameter whose value is to be set
- * @param Time object to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTime(int parameterIndex, java.sql.Time value) throws SQLException {
setTime(parameterIndex, value, null);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Time object. The
parameter
- * type is set to TIME
- * @param parameterIndex of the parameter whose value is to be set
- * @param Time object to which the parameter value is to be set.
- * @param Calendar object to constrct Time(useful to get include timezone info)
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTime(int parameterIndex, java.sql.Time x, java.util.Calendar cal)
throws SQLException {
if (cal == null || x == null) {
@@ -598,25 +461,10 @@
setObject(parameterIndex, TimestampWithTimezone.createTime(x, cal.getTimeZone(),
getDefaultCalendar()));
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Timestamp object.
The
- * parameter type is set to TIMESTAMP
- * @param parameterIndex of the parameter whose value is to be set
- * @param Timestamp object to which the parameter value is to be set.
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTimestamp(int parameterIndex, java.sql.Timestamp value) throws
SQLException {
setTimestamp(parameterIndex, value, null);
}
- /**
- * <p>Sets parameter number parameterIndex to x, a java.sql.Timestamp object.
The
- * parameter type is set to TIMESTAMP
- * @param parameterIndex of the parameter whose value is to be set
- * @param Timestamp object to which the parameter value is to be set.
- * @param Calendar object to constrct timestamp(useful to get include timezone info)
- * @throws SQLException, if parameter type/datatype do not match
- */
public void setTimestamp(int parameterIndex, java.sql.Timestamp x, java.util.Calendar
cal) throws SQLException {
if (cal == null || x == null) {
@@ -628,13 +476,6 @@
setObject(parameterIndex, TimestampWithTimezone.createTimestamp(x,
cal.getTimeZone(), getDefaultCalendar()));
}
- /**
- * Sets the designated parameter to the given java.net.URL value. The driver
- * converts this to an SQL DATALINK value when it sends it to the database.
- * @param parameter int index
- * @param x URL to be set
- * @throws SQLException
- */
public void setURL(int parameterIndex, URL x) throws SQLException {
setObject(parameterIndex, x);
}
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-11-08 17:48:30 UTC
(rev 3619)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-11-08 19:02:22 UTC
(rev 3620)
@@ -655,55 +655,22 @@
return reqMessage;
}
- /**
- * Retreives the fetch direction this Statement object set as a performance hint
- * to the driver. The int returned will be one of the following constants from
- * the ResultSet interface: FETCH_FORWARD, FETCH_REVERSE, or FETCH_UNKNOWN.
- * @return int value indicating the direction in which results need to be fetched
- * @throws SQLException should never occur.
- */
public int getFetchDirection() throws SQLException {
return this.fetchDirection;
}
- /**
- * Retreives the fetch size this Statement object set as a performance hint
- * to the driver. This is the number of rows the server fetches at a time when
- * the result set needs more rows.
- * @return int value indicating the number of rows the server fetches
- * @throws SQLException should never occur.
- */
public int getFetchSize() throws SQLException {
return fetchSize;
}
- /**
- * Retreives the maximum number of bytes that a result set column may contain.
- * @return int value giving the maximum size of a field
- * @throws SQLException should never occur.
- */
public int getMaxFieldSize() throws SQLException {
return maxFieldSize;
}
- /**
- * Retrives the maximum number of rows that a ResultSet object may contain.
- * If the limit is exceeded the excess rows are dropped.
- * @return Max limit on rows on ResultSet.
- * @throws SQLException should never iccure.
- */
public int getMaxRows() throws SQLException {
return maxRows;
}
- /**
- * Moves to this Statement object's next result, returns true if
- * it is a ResultSet object, and implicitly closes any current
- * ResultSet object(s) obtained with the method #getResultSet.
- * @return true if the next result is a ResultSet object;
- * false if it is an update count or there are no more results
- * @throws SQLException if there is an error in database.
- */
public boolean getMoreResults() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -719,17 +686,6 @@
return false;
}
- /**
- * Moves to this Statement object's next result, deals with any current
- * ResultSet object(s) according to the instructions specified by the
- * given flag, and returns true if the next result is a ResultSet object.
- * @param current flag that gives instruction on what should happen
- * to current ResultSet objects obtained using the method getResultSet(
- * CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS).
- * @return true if the next result is a ResultSet object; false if it
- * is an update count or there are no more results
- * @throws SQLException if there is an error in database.
- */
public boolean getMoreResults(int current) throws SQLException {
checkStatement();
@@ -748,26 +704,12 @@
return false;
}
-
- /**
- * Return the number of seconds the driver will wait for a statement object
- * to execute
- * @return int value giving the query timeout in seconds
- * @throws SQLException should never occur
- */
public int getQueryTimeout() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
return (int)this.queryTimeoutMS/1000;
}
- /**
- * Returns a ResultSet object that was produced by a call to the method execute.
- * We currently do not support execute method which could return multiple result
- * sets.
- * @return ResultSet object giving the next available ResultSet
- * @throws SQLException should never occur
- */
public ResultSetImpl getResultSet() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -777,32 +719,14 @@
return resultSet;
}
- /**
- * Retrieves the concurrency mode for the ResultSet objects generated from
- * queries that this Statement object executes. All ResultSets are currently
- * read only.
- * @return intvalue giving the ResultSet concurrency
- * @throws SQLException should never occur
- */
public int getResultSetConcurrency() throws SQLException {
return this.resultSetConcurrency;
}
- /**
- * Retrieves the type of the ResultSet objects generated from queries that this
- * statement executes.
- * @return int value indicating the type of the ResultSet
- * @throws SQLException should never occur
- */
public int getResultSetType() {
return this.resultSetType;
}
- /**
- * This method returns the number of rows affected by a statement modifying a table.
- * @return Number of rows affected.
- * @throws SQLException should never occur
- */
public int getUpdateCount() throws SQLException {
checkStatement();
if (this.updateCounts == null) {
@@ -821,11 +745,6 @@
this.serverWarnings.addAll(serverWarnings);
}
- /**
- * This method returns warnings returned by server.
- * @return null value as there are no warnings
- * @throws SQLException should never occur
- */
public SQLWarning getWarnings() throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -836,13 +755,6 @@
return null;
}
- /**
- * This method enbles/disables escape processing. When escape processing is
- * enabled the driver will scan any escape syntax and do escape substitution
- * before sending the escaped sql statement to the server
- * @param enable boolean value indicating if the escape processing should be turned
on
- * @throws SQLException should never occur
- */
public void setEscapeProcessing(boolean enable) throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -868,24 +780,12 @@
}
}
- /**
- * Sets the limit on the maximum number of rows in a ResultSet object. This
- * method is currently implemented to throw an exception as it is not possible
- * to limit the number of rows.
- * @param maxRows int value indicating maximum rows that can be returned in a
ResultSet
- */
public void setMaxRows(int maxRows) throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
this.maxRows = maxRows;
}
- /**
- * This sets to seconds the time limit for the number of seconds for a driver
- * to wait for a statement object to be executed.
- * @param seconds Maximum number of seconds for a statement object to execute.
- * throws SQLException, should never occur
- */
public void setQueryTimeout(int seconds) throws SQLException {
//Check to see the statement is closed and throw an exception
checkStatement();
@@ -985,20 +885,6 @@
}
}
- /**
- * Set the per-statement security payload. This optional payload will
- * accompany each request to the data source(s) so that the connector
- * will have access to it.
- * <br>Once the payload is set, it will be used for each statment
- * execution until it is set to <code>null</code>, a new payload is set
on
- * the statement or the statement is closed.</br>
- *
- * <p>To remove an existing payload from a statement, call this method
- * with a <code>null</code> argument.</p>
- * @param payload The payload that is to accompany requests executed
- * from this statement.
- * @since 4.2
- */
public void setPayload(Serializable payload) {
this.payload = payload;
}
@@ -1015,15 +901,6 @@
return this.currentRequestID;
}
- /**
- * Get Query plan description.
- * If the Statement has a resultSet, we get the plan description from the result set
- * If that plan description is null, though, we return the very first plan
description
- * that was created from the resultsMessage in the method: setAnalysisInfo.
- * The plan description from the result set can be null if the resultsMsg stored in
the
- * result set hasn't been created when getPlanDescription is called.
- * @return Query plan description, if it exists, otherwise null
- */
public PlanNode getPlanDescription() {
if(this.resultSet != null) {
return this.resultSet.getUpdatedPlanDescription();
@@ -1034,18 +911,10 @@
return null;
}
- /**
- * Get query planner debug log.
- * @return Query planner debug log, or null if it doesn't exist
- */
public String getDebugLog() {
return this.debugLog;
}
- /**
- * Get annotations
- * @return Query planner annotations - Collection of Annotation
- */
public Collection<Annotation> getAnnotations() {
return this.annotations;
}
@@ -1057,10 +926,6 @@
return null;
}
- /**
- * Check is the statement is closed. Used primarily by the unit tests.
- * @return true if the statement is closed; false otherwise.
- */
public boolean isClosed() {
return this.isClosed;
}