You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by db...@apache.org on 2016/05/24 16:34:45 UTC
[1/9] incubator-trafodion git commit: Rename required prefix with Traf
Repository: incubator-trafodion
Updated Branches:
refs/heads/master d02fe4781 -> 927ab50bf
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSetMetaData.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSetMetaData.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSetMetaData.java
new file mode 100644
index 0000000..5b4d4cd
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSetMetaData.java
@@ -0,0 +1,309 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.SQLException;
+import java.util.logging.Level;
+
+public class TrafT4ResultSetMetaData implements java.sql.ResultSetMetaData {
+
+ // begin required methods
+ public String getCatalogName(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].catalogName_;
+ }
+
+ public String getColumnClassName(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].getColumnClassName();
+ }
+
+ public int getColumnCount() throws SQLException {
+ return outputDesc_.length;
+ }
+
+ public int getColumnDisplaySize(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].displaySize_;
+ }
+
+ public String getColumnLabel(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+
+ return (outputDesc_[column - 1].columnLabel_ == null) ? outputDesc_[column - 1].name_
+ : outputDesc_[column - 1].columnLabel_;
+ }
+
+ public String getColumnName(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].name_;
+ }
+
+ public int getColumnType(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].dataType_;
+ }
+
+ public String getColumnTypeName(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].getColumnTypeName(connection_.getLocale());
+ }
+
+ public int getPrecision(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].precision_;
+ }
+
+ public int getScale(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].scale_;
+ }
+
+ public String getSchemaName(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].schemaName_;
+ }
+
+ public String getTableName(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].tableName_;
+ }
+
+ public boolean isAutoIncrement(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].isAutoIncrement_;
+ }
+
+ public boolean isCaseSensitive(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].isCaseSensitive_;
+ }
+
+ public boolean isCurrency(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].isCurrency_;
+ }
+
+ public boolean isDefinitelyWritable(int column) throws SQLException {
+ return true;
+ }
+
+ public int isNullable(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].isNullable_;
+ }
+
+ public boolean isReadOnly(int column) throws SQLException {
+ return false;
+ }
+
+ public boolean isSearchable(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].isSearchable_;
+ }
+
+ public boolean isSigned(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].isSigned_;
+ }
+
+ public boolean isWritable(int column) throws SQLException {
+ return true;
+ }
+
+ // ////////////////////////
+ // begin custom accessors//
+ // ////////////////////////
+
+ public int getFSDataType(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].fsDataType_;
+ }
+
+ public int getMaxLength(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].maxLen_;
+ }
+
+ public int getOdbcCharset(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].odbcCharset_;
+ }
+
+ public int getRowLength() throws SQLException {
+ // this is the same for all params
+ // only if we have no input params will we throw an error
+ if (outputDesc_.length == 0) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.props_.getLocale(),
+ "invalid_desc_index", null);
+ }
+
+ return outputDesc_[0].rowLength_;
+ }
+
+ public int getSqlCharset(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].sqlCharset_;
+ }
+
+ public int getSqlPrecision(int column) throws SQLException {
+ if (column > outputDesc_.length) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].sqlPrecision_;
+ }
+
+ public int getSqlDatetimeCode(int param) throws SQLException {
+ return stmt_.ist_.pr_.outputDesc[param - 1].datetimeCode_;
+ }
+
+ // /////////////////////////////////
+ // these are legacy names...do not remove these yet even though they are
+ // duplicate
+ // ///////////////////////////////
+
+ /**
+ * @deprecated
+ */
+ public String cpqGetCharacterSet(int column) throws SQLException {
+ if ((column > outputDesc_.length) || (column <= 0)) {
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
+ null);
+ }
+ return outputDesc_[column - 1].getCharacterSetName();
+ }
+
+ /**
+ * @deprecated
+ */
+ public int getSqlTypeCode(int param) throws SQLException {
+ return stmt_.ist_.pr_.outputDesc[param - 1].dataType_;
+ } // end getSqlTypeCode
+
+ /**
+ * @deprecated
+ */
+ public int getSqlLength(int param) throws SQLException {
+ return stmt_.ist_.pr_.outputDesc[param - 1].maxLen_;
+ } // end getSqlTypeCode
+
+ TrafT4ResultSetMetaData(TrafT4Statement stmt, TrafT4Desc[] outputDesc) {
+ if (stmt.connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(stmt.connection_.props_, stmt, outputDesc);
+ stmt.connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4ResultSetMetaData", "", "", p);
+ }
+
+ connection_ = stmt.connection_;
+ outputDesc_ = outputDesc;
+ stmt_ = stmt;
+ }
+
+ TrafT4ResultSetMetaData(TrafT4ResultSet resultSet, TrafT4Desc[] outputDesc) {
+ if (resultSet.connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(resultSet.connection_.props_, resultSet, outputDesc);
+ resultSet.connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4ResultSetMetaData", "", "", p);
+ }
+
+ resultSet_ = resultSet;
+ connection_ = resultSet_.connection_;
+ outputDesc_ = outputDesc;
+ stmt_ = resultSet.stmt_;
+ }
+
+ TrafT4ResultSet resultSet_;
+ TrafT4Connection connection_;
+ TrafT4Desc[] outputDesc_;
+ TrafT4Statement stmt_;
+ public Object unwrap(Class iface) throws SQLException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isWrapperFor(Class iface) throws SQLException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Statement.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Statement.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Statement.java
index d28746f..9e16f22 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Statement.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Statement.java
@@ -42,7 +42,7 @@ import java.util.logging.LogRecord;
* the <code>java.sql.Statement</code> interface.
* </p>
*/
-public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
+public class TrafT4Statement extends TrafT4Handle implements java.sql.Statement {
// java.sql.Statement interface Methods
public void addBatch(String sql) throws SQLException {
@@ -265,7 +265,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
if (autoGeneratedKeys == TrafT4Statement.NO_GENERATED_KEYS) {
ret = execute(sql);
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"auto_generated_keys_not_supported", null);
}
return ret;
@@ -293,7 +293,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
} else if (columnIndexes.length == 0) {
ret = execute(sql);
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"auto_generated_keys_not_supported", null);
}
return ret;
@@ -321,7 +321,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
} else if (columnNames.length == 0) {
ret = execute(sql);
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"auto_generated_keys_not_supported", null);
}
return ret;
@@ -359,7 +359,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
String sql = (String) batchCommands_.get(i);
if (sql == null) {
- se = HPT4Messages.createSQLException(connection_.props_, this.ist_.ic_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, this.ist_.ic_.getLocale(),
"batch_command_failed", "Invalid SQL String");
throw new BatchUpdateException(se.getMessage(), se.getSQLState(), new int[0]);
}
@@ -367,15 +367,15 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
sqlStmtType_ = ist_.getSqlStmtType(sql);
if (sqlStmtType_ == TRANSPORT.TYPE_SELECT) {
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"select_in_batch_not_supported", null);
throw new BatchUpdateException(se.getMessage(), se.getSQLState(), new int[0]);
} else if (sqlStmtType_ == TRANSPORT.TYPE_STATS) {
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"infostats_invalid_error", null);
throw new BatchUpdateException(se.getMessage(), se.getSQLState(), new int[0]);
} else if (sqlStmtType_ == TRANSPORT.TYPE_CONFIG) {
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"config_cmd_invalid_error", null);
throw new BatchUpdateException(se.getMessage(), se.getSQLState(), new int[0]);
}
@@ -415,7 +415,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
BatchUpdateException be;
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"batch_command_failed", null);
be = new BatchUpdateException(se.getMessage(), se.getSQLState(), batchRowCount_);
be.setNextException(e);
@@ -460,7 +460,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
validateExecDirectInvocation(sql);
if (sqlStmtType_ != TRANSPORT.TYPE_SELECT && sqlStmtType_ != TRANSPORT.TYPE_STATS) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "non_select_invalid",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "non_select_invalid",
null);
}
try {
@@ -508,7 +508,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
validateExecDirectInvocation(sql);
// 7708
if (sqlStmtType_ == TRANSPORT.TYPE_SELECT && (ist_.stmtIsLock != true)) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "select_invalid", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "select_invalid", null);
}
try {
ist_.execute(TRANSPORT.SRVR_API_SQLEXECDIRECT, 0, 0, null, queryTimeout_, sql_, this);
@@ -548,7 +548,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
if (autoGeneratedKeys == TrafT4Statement.NO_GENERATED_KEYS) {
ret = executeUpdate(sql);
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"auto_generated_keys_not_supported", null);
}
return ret;
@@ -576,7 +576,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
} else if (columnIndexes.length == 0) {
ret = executeUpdate(sql);
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"auto_generated_keys_not_supported", null);
}
return ret;
@@ -604,7 +604,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
} else if (columnNames.length == 0) {
ret = executeUpdate(sql);
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"auto_generated_keys_not_supported", null);
}
return ret;
@@ -682,7 +682,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
connection_.props_.getLogWriter().println(temp);
}
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"auto_generated_keys_not_supported", null);
}
@@ -905,7 +905,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
}
if (ist_ == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_statement_handle", null);
}
@@ -1029,7 +1029,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
fetchDirection_ = ResultSet.FETCH_FORWARD;
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_fetch_direction", null);
}
}
@@ -1051,7 +1051,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
}
if (rows < 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_fetch_size",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_fetch_size",
null);
} else if (rows == 0) {
fetchSize_ = TrafT4ResultSet.DEFAULT_FETCH_SIZE;
@@ -1077,7 +1077,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
}
if (max < 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_maxFieldSize_value", null);
}
maxFieldSize_ = max;
@@ -1100,7 +1100,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
}
if (max < 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_maxRows_value",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_maxRows_value",
null);
}
maxRows_ = max;
@@ -1122,10 +1122,10 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
connection_.props_.getLogWriter().println(temp);
}
- //HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setQueryTimeout()");
+ //TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setQueryTimeout()");
if (seconds < 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_queryTimeout_value", null);
}
queryTimeout_ = seconds;
@@ -1181,7 +1181,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
ist_.setRowCount(-1);
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_statement",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_statement",
null);
}
try {
@@ -1213,7 +1213,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
}
}
- private void setResultSet(HPT4Desc[] outputDesc) throws SQLException {
+ private void setResultSet(TrafT4Desc[] outputDesc) throws SQLException {
if (connection_.props_.t4Logger_.isLoggable(Level.FINER) == true) {
Object p[] = T4LoggingUtilities.makeParams(connection_.props_, outputDesc);
connection_.props_.t4Logger_.logp(Level.FINER, "TrafT4Statement", "setResultSet", "", p);
@@ -1235,7 +1235,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
this.transactionToJoin = txid;
}
- void setMultipleResultSets(int num_result_sets, HPT4Desc[][] output_descriptors, String[] stmt_labels,
+ void setMultipleResultSets(int num_result_sets, TrafT4Desc[][] output_descriptors, String[] stmt_labels,
String[] proxySyntax) throws SQLException {
if (num_result_sets < 1)
return;
@@ -1243,7 +1243,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
resultSet_ = new TrafT4ResultSet[num_result_sets];
num_result_sets_ = num_result_sets;
for (int i = 0; i < num_result_sets; i++) {
- HPT4Desc[] desc = output_descriptors[i];
+ TrafT4Desc[] desc = output_descriptors[i];
if (desc == null) {
resultSet_[i] = null;
} else {
@@ -1254,7 +1254,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
}
// ----------------------------------------------------------------------------------
- void setExecute2Outputs(byte[] values, short rowsAffected, boolean endOfData, String[] proxySyntax, HPT4Desc[] desc)
+ void setExecute2Outputs(byte[] values, short rowsAffected, boolean endOfData, String[] proxySyntax, TrafT4Desc[] desc)
throws SQLException {
num_result_sets_ = 1;
result_set_offset = 0;
@@ -1406,7 +1406,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
if (resultSetType != ResultSet.TYPE_FORWARD_ONLY && resultSetType != ResultSet.TYPE_SCROLL_INSENSITIVE
&& resultSetType != ResultSet.TYPE_SCROLL_SENSITIVE) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_resultset_type", null);
}
@@ -1418,13 +1418,13 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
resultSetType_ = resultSetType;
}
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY && resultSetConcurrency != ResultSet.CONCUR_UPDATABLE) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_resultset_concurrency", null);
}
if ((resultSetHoldability != 0) && (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT)
&& (resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT)) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_holdability",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_holdability",
null);
}
@@ -1471,7 +1471,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
if (resultSetType != ResultSet.TYPE_FORWARD_ONLY && resultSetType != ResultSet.TYPE_SCROLL_INSENSITIVE
&& resultSetType != ResultSet.TYPE_SCROLL_SENSITIVE) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_resultset_type", null);
}
@@ -1483,13 +1483,13 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
resultSetType_ = resultSetType;
}
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY && resultSetConcurrency != ResultSet.CONCUR_UPDATABLE) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_resultset_concurrency", null);
}
if ((resultSetHoldability != 0) && (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT)
&& (resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT)) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_holdability",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_holdability",
null);
}
@@ -1555,7 +1555,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
roundingMode_ = Utility.getRoundingMode(roundingMode);
}
- void closeErroredConnection(HPT4Exception sme) {
+ void closeErroredConnection(TrafT4Exception sme) {
connection_.closeErroredConnection(sme);
}
@@ -1625,7 +1625,7 @@ public class TrafT4Statement extends HPT4Handle implements java.sql.Statement {
int roundingMode_ = BigDecimal.ROUND_HALF_EVEN;
- HPT4Desc[] inputDesc_, outputDesc_;
+ TrafT4Desc[] inputDesc_, outputDesc_;
short operationID_;
byte[] operationBuffer_;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Utility.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Utility.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Utility.java
index a3224d7..7099fa7 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Utility.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Utility.java
@@ -105,7 +105,7 @@ class Utility {
double indbl = inbd.doubleValue();
// double abdbl = inbd.abs().doubleValue(); Need to do MIN check as well
if (indbl > (double) Float.MAX_VALUE) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
}
} // end checkFloatBoundary
@@ -126,7 +126,7 @@ class Utility {
// need to check min as well
// BigDecimal minbd = new BigDecimal(Double.MIN_VALUE);
if ((inbd.compareTo(maxbd) > 0)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
}
} // end checkDoubleBoundary
@@ -146,7 +146,7 @@ class Utility {
static void checkIntegerBoundary(Locale locale, BigDecimal inbd) throws SQLException {
long inlong = inbd.longValue();
if ((inlong > Integer.MAX_VALUE) || (inlong < Integer.MIN_VALUE)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
}
} // end checkIntegerBoundary
@@ -167,7 +167,7 @@ class Utility {
BigDecimal maxbd = new BigDecimal(Long.MAX_VALUE);
maxbd = maxbd.add(maxbd);
if ((inlong < 0) || (inbd.compareTo(maxbd) > 0)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
}
} // end checkIntegerBoundary
@@ -187,7 +187,7 @@ class Utility {
long inlong = inbd.longValue();
long maxushort = (Short.MAX_VALUE * 2) + 1;
if ((inlong < 0) || (inlong > maxushort)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
}
} // end checkIntegerBoundary
@@ -207,7 +207,7 @@ class Utility {
long inlong = inbd.longValue();
long maxuint = ((long) Integer.MAX_VALUE * 2L) + 1L;
if ((inlong < 0) || (inlong > maxuint)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
}
} // end checkIntegerBoundary
@@ -226,7 +226,7 @@ class Utility {
static void checkTinyintBoundary(Locale locale, BigDecimal inbd) throws SQLException {
long inlong = inbd.longValue();
if ((inlong > Byte.MAX_VALUE) || (inlong < Byte.MIN_VALUE)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
}
} // end checkTinyintBoundary
@@ -245,7 +245,7 @@ class Utility {
static void checkShortBoundary(Locale locale, BigDecimal inbd) throws SQLException {
long inlong = inbd.longValue();
if ((inlong > Short.MAX_VALUE) || (inlong < Short.MIN_VALUE)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", String.valueOf(inlong));
}
} // end checkShortBoundary
@@ -296,7 +296,7 @@ class Utility {
* BigDecimal.valueOf(((DataWrapper)paramValue).longValue);
*/
} else {
- throw HPT4Messages.createSQLException(null, locale, "object_type_not_supported", paramValue);
+ throw TrafT4Messages.createSQLException(null, locale, "object_type_not_supported", paramValue);
}
return tmpbd;
} // end getBigDecimalValue
@@ -319,7 +319,7 @@ class Utility {
BigDecimal maxbd = new BigDecimal(Math.pow(10, precision));
BigDecimal minbd = maxbd.negate();
if ((inbd.compareTo(maxbd) >= 0) || (inbd.compareTo(minbd) < 0)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
}
}
} // end checkBigDecimalBoundary
@@ -350,7 +350,7 @@ class Utility {
Object[] messageArguments = new Object[1];
messageArguments[0] = new String("A numeric overflow occurred during an arithmetic computation " +
"or data conversion.");
- throw HPT4Messages.createSQLWarning(null, "8411", messageArguments);
+ throw TrafT4Messages.createSQLWarning(null, "8411", messageArguments);
}
catch (SQLWarning e)
{
@@ -449,7 +449,7 @@ class Utility {
*/
static void checkLongBoundary(Locale locale, BigDecimal inbd) throws SQLException {
if ((inbd.compareTo(long_maxbd) > 0) || (inbd.compareTo(long_minbd) < 0)) {
- throw HPT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
+ throw TrafT4Messages.createSQLException(null, locale, "numeric_out_of_range", inbd.toString());
}
} // end checkBigDecimalBoundary
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_GetObjRefHdl_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_GetObjRefHdl_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_GetObjRefHdl_exc_.java
index 564fe5b..a641e8a 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_GetObjRefHdl_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_GetObjRefHdl_exc_.java
@@ -37,7 +37,7 @@ class odbc_Dcs_GetObjRefHdl_exc_ {
// error cases, so the following variable will contain
// any error text generated by this JDBC driver.
// Note, this variable is not part of the message, but it
- // represents a value stored in the HPT4Messages_*.properties file.
+ // represents a value stored in the TrafT4Messages_*.properties file.
//
String clientErrorText;
@@ -67,13 +67,13 @@ class odbc_Dcs_GetObjRefHdl_exc_ {
case TRANSPORT.CEE_SUCCESS:
break;
case odbc_Dcs_GetObjRefHdl_ASParamError_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ErrorText);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ErrorText);
case odbc_Dcs_GetObjRefHdl_LogonUserFailure_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unable_to_logon", "");
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unable_to_logon", "");
case odbc_Dcs_GetObjRefHdl_ASNotAvailable_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_dcs_srvr_not_available", ErrorText);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_dcs_srvr_not_available", ErrorText);
case odbc_Dcs_GetObjRefHdl_DSNotAvailable_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_ds_not_available", new T4Properties()
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_ds_not_available", new T4Properties()
.getServerDataSource());
case odbc_Dcs_GetObjRefHdl_PortNotAvailable_exn_:
case odbc_Dcs_GetObjRefHdl_ASTryAgain_exn_:
@@ -85,11 +85,11 @@ class odbc_Dcs_GetObjRefHdl_exc_ {
clientErrorText = "ids_port_not_available";
break;
case odbc_Dcs_GetObjRefHdl_InvalidUser_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_28_000", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_28_000", null);
case odbc_Dcs_GetObjRefHdl_ASTimeout_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_t00", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_t00", null);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "unknown_connect_error", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "unknown_connect_error", null);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_StopSrvr_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_StopSrvr_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_StopSrvr_exc_.java
index 44b6796..6c36de4 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_StopSrvr_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_Dcs_StopSrvr_exc_.java
@@ -41,7 +41,7 @@ class odbc_Dcs_StopSrvr_exc_ {
// error cases, so the following variable will contain
// any error text generated by this JDBC driver.
// Note, this variable is not part of the message, but it
- // represents a value stored in the HPT4Messages_*.properties file.
+ // represents a value stored in the TrafT4Messages_*.properties file.
//
String clientErrorText;
@@ -74,13 +74,13 @@ class odbc_Dcs_StopSrvr_exc_ {
case odbcas_ASSvc_StopSrvr_ProcessStopError_exn_:
case odbcas_ASSvc_StopSrvr_SrvrInUseByAnotherClient_exn_:
ErrorText = ic.decodeBytes(buffer1.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ErrorText);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ErrorText);
case odbcas_ASSvc_StopSrvr_ASNotAvailable_exn_:
ErrorText = ic.decodeBytes(buffer1.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_dcs_srvr_not_available", ErrorText);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_dcs_srvr_not_available", ErrorText);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "unknown_error", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "unknown_error", null);
} // end switch
} // end extractFromByteArray
} // end odbc_Dcs_StopSrvr_exc_
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Close_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Close_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Close_exc_.java
index 619bece..ebd7e8c 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Close_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Close_exc_.java
@@ -57,13 +57,13 @@ class odbc_SQLSvc_Close_exc_ {
case odbc_SQLSvc_Close_ParamError_exn_:
ParamError = ic.decodeBytes(buf.extractString(), 1);
;
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_Close_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
case odbc_SQLSvc_Close_TransactionError_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_EndTransaction_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_EndTransaction_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_EndTransaction_exc_.java
index f46d161..2f1aed4 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_EndTransaction_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_EndTransaction_exc_.java
@@ -74,13 +74,13 @@ class odbc_SQLSvc_EndTransaction_exc_ {
break;
case odbc_SQLSvc_EndTransaction_ParamError_exn_:
ParamError = ic.decodeBytes(buffer1.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_EndTransaction_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
case odbc_SQLSvc_EndTransaction_SQLInvalidHandle_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
} // end switch
} // end extractFromByteArray
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Execute_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Execute_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Execute_exc_.java
index ebf444e..ea23bd0 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Execute_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Execute_exc_.java
@@ -66,7 +66,7 @@ class odbc_SQLSvc_Execute_exc_ {
case odbc_SQLSvc_Execute_SQLStillExecuting_exn_:
break;
case odbc_SQLSvc_Execute_SQLQueryCancelled_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_008", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_008", null);
case odbc_SQLSvc_Execute_SQLError_exn_:
SQLError = new ERROR_DESC_LIST_def();
SQLError.extractFromByteArray(buf, ic);
@@ -77,13 +77,13 @@ class odbc_SQLSvc_Execute_exc_ {
break;
case odbc_SQLSvc_Execute_ParamError_exn_:
ParamError = ic.decodeBytes(buf.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_Execute_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
case odbc_SQLSvc_Execute_TransactionError_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Fetch_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Fetch_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Fetch_exc_.java
index b125b5d..970aece 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Fetch_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Fetch_exc_.java
@@ -67,20 +67,20 @@ class odbc_SQLSvc_Fetch_exc_ {
case odbc_SQLSvc_Fetch_SQLNoDataFound_exn_:
break;
case odbc_SQLSvc_Fetch_SQLQueryCancelled_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_008", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_008", null);
case odbc_SQLSvc_Fetch_SQLError_exn_:
SQLError = new ERROR_DESC_LIST_def();
SQLError.extractFromByteArray(buffer1, ic);
break;
case odbc_SQLSvc_Fetch_ParamError_exn_:
ParamError = ic.decodeBytes(buffer1.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_Fetch_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
case odbc_SQLSvc_Fetch_TransactionError_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp1, addr);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
}
} // end extractFromByteArray
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_GetSQLCatalogs_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_GetSQLCatalogs_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_GetSQLCatalogs_exc_.java
index c48c67f..78bf2b8 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_GetSQLCatalogs_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_GetSQLCatalogs_exc_.java
@@ -87,13 +87,13 @@ class odbc_SQLSvc_GetSQLCatalogs_exc_ {
break;
case odbc_SQLSvc_GetSQLCatalogs_ParamError_exn_:
ParamError = ic.decodeBytes(buffer1.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_GetSQLCatalogs_SQLInvalidHandle_exn_:
break;
case odbc_SQLSvc_GetSQLCatalogs_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
}
} // end extractFromByteArray
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_InitializeDialogue_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_InitializeDialogue_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_InitializeDialogue_exc_.java
index 0488eef..1eb43e1 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_InitializeDialogue_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_InitializeDialogue_exc_.java
@@ -61,12 +61,12 @@ class odbc_SQLSvc_InitializeDialogue_exc_ {
SQLError.extractFromByteArray(buf, ic);
break;
case odbc_SQLSvc_InitializeDialogue_InvalidUser_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_28_000", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_28_000", null);
case odbc_SQLSvc_InitializeDialogue_ParamError_exn_:
ParamError = ic.decodeBytes(buf.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_InitializeDialogue_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
default:
clientErrorText = "unknown_initialize_dialogue_reply_error";
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Prepare_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Prepare_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Prepare_exc_.java
index 62d056a..0374978 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Prepare_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_Prepare_exc_.java
@@ -51,18 +51,18 @@ class odbc_SQLSvc_Prepare_exc_ {
case odbc_SQLSvc_Prepare_SQLStillExecuting_exn_:
break;
case odbc_SQLSvc_Prepare_SQLQueryCancelled_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_008", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_s1_008", null);
case odbc_SQLSvc_Prepare_SQLError_exn_:
break;
case odbc_SQLSvc_Prepare_ParamError_exn_:
sqlError = ic.decodeBytes(buf.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", sqlError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", sqlError, addr);
case odbc_SQLSvc_Prepare_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
case odbc_SQLSvc_Prepare_TransactionError_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp0, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_transaction_error", temp0, addr);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_SetConnectionOption_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_SetConnectionOption_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_SetConnectionOption_exc_.java
index 192e527..5dfde73 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_SetConnectionOption_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_SetConnectionOption_exc_.java
@@ -52,19 +52,19 @@ class odbc_SQLSvc_SetConnectionOption_exc_ {
case odbc_SQLSvc_SetConnectionOption_SQLError_exn_:
SQLError = new ERROR_DESC_LIST_def();
SQLError.extractFromByteArray(buf, ic);
- HPT4Messages.throwSQLException(ic.t4props_, SQLError);
+ TrafT4Messages.throwSQLException(ic.t4props_, SQLError);
case odbc_SQLSvc_SetConnectionOption_ParamError_exn_:
ParamError = ic.decodeBytes(buf.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_SetConnectionOption_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
case odbc_SQLSvc_SetConnectionOption_SQLInvalidHandle_exn_:
// SQLInvalidHandle
- // throw HPT4Messages.createSQLException(null, locale, "ids_08_s01",
+ // throw TrafT4Messages.createSQLException(null, locale, "ids_08_s01",
// null);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "autocommit_txn_in_progress", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "autocommit_txn_in_progress", null);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_TerminateDialogue_exc_.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_TerminateDialogue_exc_.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_TerminateDialogue_exc_.java
index 6242b6e..471ccd1 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_TerminateDialogue_exc_.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/odbc_SQLSvc_TerminateDialogue_exc_.java
@@ -49,18 +49,18 @@ class odbc_SQLSvc_TerminateDialogue_exc_ {
break;
case odbc_SQLSvc_TerminateDialogue_SQLError_exn_:
if (exception_detail == 25000) {
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_25_000", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_25_000", null);
}
SQLError = new ERROR_DESC_LIST_def();
SQLError.extractFromByteArray(buffer1, ic);
break;
case odbc_SQLSvc_TerminateDialogue_ParamError_exn_:
ParamError = ic.decodeBytes(buffer1.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_TerminateDialogue_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
default:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_unknown_reply_error", temp0, temp1);
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/test/java/org/trafodion/jdbc/t4/RunAllTests.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/test/java/org/trafodion/jdbc/t4/RunAllTests.java b/core/conn/jdbcT4/src/test/java/org/trafodion/jdbc/t4/RunAllTests.java
index 0de5f33..b72ef9a 100644
--- a/core/conn/jdbcT4/src/test/java/org/trafodion/jdbc/t4/RunAllTests.java
+++ b/core/conn/jdbcT4/src/test/java/org/trafodion/jdbc/t4/RunAllTests.java
@@ -1,3 +1,5 @@
+package org.trafodion.jdbc.t4;
+
/*
* @@@ START COPYRIGHT @@@
*
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/rest/src/main/java/org/trafodion/rest/util/JdbcT4Util.java
----------------------------------------------------------------------
diff --git a/core/rest/src/main/java/org/trafodion/rest/util/JdbcT4Util.java b/core/rest/src/main/java/org/trafodion/rest/util/JdbcT4Util.java
index 2145d31..497a8c7 100644
--- a/core/rest/src/main/java/org/trafodion/rest/util/JdbcT4Util.java
+++ b/core/rest/src/main/java/org/trafodion/rest/util/JdbcT4Util.java
@@ -50,14 +50,14 @@ import org.trafodion.rest.util.RestConfiguration;
import org.trafodion.rest.Constants;
import org.trafodion.jdbc.t4.TrafT4Connection;
import org.trafodion.jdbc.t4.TrafT4PreparedStatement;
-import org.trafodion.jdbc.t4.HPT4DataSource;
+import org.trafodion.jdbc.t4.TrafT4DataSource;
public final class JdbcT4Util
{
private static final Log LOG = LogFactory.getLog(JdbcT4Util.class);
private Configuration conf;
private NetworkConfiguration netConf;
- private HPT4DataSource cpds = null;
+ private TrafT4DataSource cpds = null;
static {
try {
@@ -72,7 +72,7 @@ public final class JdbcT4Util
public void init(Configuration conf,NetworkConfiguration netConf) throws SQLException {
this.conf = conf;
this.netConf = netConf;
- cpds = new HPT4DataSource();
+ cpds = new TrafT4DataSource();
String url = Constants.T4_DRIVER_URL + "//" + netConf.getHostName() + ":" + conf.getInt(Constants.DCS_MASTER_PORT,Constants.DEFAULT_DCS_MASTER_PORT) + "/:";
cpds.setURL(url);
cpds.setMinPoolSize(conf.getInt(Constants.T4_DRIVER_MIN_POOL_SIZE,Constants.DEFAULT_T4_DRIVER_MIN_POOL_SIZE));
[9/9] incubator-trafodion git commit: Merge [TRAFODION-2003] PR 491
Rename various classes to Traf*
Posted by db...@apache.org.
Merge [TRAFODION-2003] PR 491 Rename various classes to Traf*
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/927ab50b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/927ab50b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/927ab50b
Branch: refs/heads/master
Commit: 927ab50bf4276df5c043a2903c2e3370cf446aa5
Parents: d02fe47 283190e
Author: Dave Birdsall <db...@apache.org>
Authored: Tue May 24 16:32:55 2016 +0000
Committer: Dave Birdsall <db...@apache.org>
Committed: Tue May 24 16:32:55 2016 +0000
----------------------------------------------------------------------
core/conn/jdbcT4/Makefile | 1 +
.../jdbcT4/src/main/java/T4Messages.properties | 6 +-
.../java/org/trafodion/jdbc/t4/Address.java | 2 +-
.../jdbc/t4/HPT4ConnectionPoolDataSource.java | 346 ------------
.../t4/HPT4ConnectionPoolDataSourceFactory.java | 68 ---
.../org/trafodion/jdbc/t4/HPT4DataSource.java | 366 -------------
.../jdbc/t4/HPT4DataSourceFactory.java | 62 ---
.../java/org/trafodion/jdbc/t4/HPT4Desc.java | 542 -------------------
.../org/trafodion/jdbc/t4/HPT4Exception.java | 38 --
.../java/org/trafodion/jdbc/t4/HPT4Handle.java | 84 ---
.../org/trafodion/jdbc/t4/HPT4Messages.java | 324 -----------
.../jdbc/t4/HPT4ParameterMetaData.java | 243 ---------
.../trafodion/jdbc/t4/HPT4PooledConnection.java | 238 --------
.../jdbc/t4/HPT4PooledConnectionManager.java | 385 -------------
.../jdbc/t4/HPT4ResultSetMetaData.java | 309 -----------
.../jdbc/t4/InitializeDialogueReply.java | 6 +-
.../java/org/trafodion/jdbc/t4/InputOutput.java | 50 +-
.../trafodion/jdbc/t4/InterfaceConnection.java | 52 +-
.../trafodion/jdbc/t4/InterfaceResultSet.java | 34 +-
.../trafodion/jdbc/t4/InterfaceStatement.java | 148 ++---
.../java/org/trafodion/jdbc/t4/NCSAddress.java | 22 +-
.../jdbc/t4/PreparedStatementManager.java | 2 +-
.../java/org/trafodion/jdbc/t4/T4Address.java | 24 +-
.../org/trafodion/jdbc/t4/T4Connection.java | 36 +-
.../org/trafodion/jdbc/t4/T4DSProperties.java | 6 +-
.../trafodion/jdbc/t4/T4DatabaseMetaData.java | 132 ++---
.../java/org/trafodion/jdbc/t4/T4Driver.java | 14 +-
.../org/trafodion/jdbc/t4/T4Properties.java | 20 +-
.../java/org/trafodion/jdbc/t4/T4ResultSet.java | 12 +-
.../java/org/trafodion/jdbc/t4/T4Statement.java | 20 +-
.../org/trafodion/jdbc/t4/T4_Dcs_Cancel.java | 2 +-
.../org/trafodion/jdbc/t4/T4_Dcs_Connect.java | 10 +-
.../jdbc/t4/TrafT4CallableStatement.java | 58 +-
.../org/trafodion/jdbc/t4/TrafT4Connection.java | 108 ++--
.../jdbc/t4/TrafT4ConnectionPoolDataSource.java | 346 ++++++++++++
.../TrafT4ConnectionPoolDataSourceFactory.java | 68 +++
.../org/trafodion/jdbc/t4/TrafT4DataSource.java | 366 +++++++++++++
.../jdbc/t4/TrafT4DataSourceFactory.java | 62 +++
.../java/org/trafodion/jdbc/t4/TrafT4Desc.java | 542 +++++++++++++++++++
.../org/trafodion/jdbc/t4/TrafT4Exception.java | 38 ++
.../org/trafodion/jdbc/t4/TrafT4Handle.java | 84 +++
.../org/trafodion/jdbc/t4/TrafT4Messages.java | 324 +++++++++++
.../jdbc/t4/TrafT4ParameterMetaData.java | 243 +++++++++
.../jdbc/t4/TrafT4PooledConnection.java | 238 ++++++++
.../jdbc/t4/TrafT4PooledConnectionManager.java | 385 +++++++++++++
.../jdbc/t4/TrafT4PreparedStatement.java | 118 ++--
.../org/trafodion/jdbc/t4/TrafT4ResultSet.java | 296 +++++-----
.../jdbc/t4/TrafT4ResultSetMetaData.java | 309 +++++++++++
.../org/trafodion/jdbc/t4/TrafT4Statement.java | 70 +--
.../java/org/trafodion/jdbc/t4/Utility.java | 24 +-
.../jdbc/t4/odbc_Dcs_GetObjRefHdl_exc_.java | 16 +-
.../jdbc/t4/odbc_Dcs_StopSrvr_exc_.java | 8 +-
.../jdbc/t4/odbc_SQLSvc_Close_exc_.java | 8 +-
.../t4/odbc_SQLSvc_EndTransaction_exc_.java | 8 +-
.../jdbc/t4/odbc_SQLSvc_Execute_exc_.java | 10 +-
.../jdbc/t4/odbc_SQLSvc_Fetch_exc_.java | 10 +-
.../t4/odbc_SQLSvc_GetSQLCatalogs_exc_.java | 6 +-
.../t4/odbc_SQLSvc_InitializeDialogue_exc_.java | 6 +-
.../jdbc/t4/odbc_SQLSvc_Prepare_exc_.java | 10 +-
.../odbc_SQLSvc_SetConnectionOption_exc_.java | 12 +-
.../t4/odbc_SQLSvc_TerminateDialogue_exc_.java | 8 +-
.../java/org/trafodion/jdbc/t4/RunAllTests.java | 2 +
.../org/trafodion/rest/util/JdbcT4Util.java | 6 +-
.../java/org/trafodion/dcs/util/JdbcT4Util.java | 24 +-
64 files changed, 3704 insertions(+), 3713 deletions(-)
----------------------------------------------------------------------
[4/9] incubator-trafodion git commit: Rename required prefix with Traf
Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
index d691a82..c8b4677 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
@@ -67,7 +67,7 @@ import java.util.logging.LogRecord;
* <p>
* </p>
*/
-public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseMetaData {
+public class T4DatabaseMetaData extends TrafT4Handle implements java.sql.DatabaseMetaData {
// ----------------------------------------------------------------------
// First, a variety of minor information about the target database.
@@ -3550,7 +3550,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.props_.getLogWriter().println(temp);
}
TrafT4ResultSet resultSet;
- HPT4Desc[] outputDesc;
+ TrafT4Desc[] outputDesc;
ObjectArray[] rows;
String[] rowValue;
@@ -3558,8 +3558,8 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
- outputDesc = new HPT4Desc[1];
- outputDesc[0] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc = new TrafT4Desc[1];
+ outputDesc[0] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TABLE_TYPE", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
resultSet = new TrafT4ResultSet(this, outputDesc, "", true);
@@ -3773,7 +3773,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_tableName",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_tableName",
null);
}
//
@@ -3967,7 +3967,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
null);
}
@@ -4062,7 +4062,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
null);
}
//
@@ -4147,7 +4147,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
null);
}
//
@@ -4262,7 +4262,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "table_cannot_be_null",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "table_cannot_be_null",
null);
}
//
@@ -4377,7 +4377,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "table_cannot_be_null",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "table_cannot_be_null",
null);
}
//
@@ -4502,7 +4502,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (primaryTable == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"primaryTable_cannot_be_null", null);
}
//
@@ -4514,7 +4514,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
// case.
// The same thing applies to the foreign* parameters.
if (foreignTable == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"foreigntable_cannot_be_null", null);
}
@@ -4698,7 +4698,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
null);
}
//
@@ -4806,7 +4806,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.isConnectionOpen();
if (table == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_use_of_null",
null);
}
//
@@ -4918,27 +4918,27 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.props_.getLogWriter().println(temp);
}
TrafT4ResultSet resultSet;
- HPT4Desc[] outputDesc;
+ TrafT4Desc[] outputDesc;
ObjectArray[] rows;
clearWarnings();
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
- outputDesc = new HPT4Desc[7];
- outputDesc[0] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc = new TrafT4Desc[7];
+ outputDesc[0] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_CAT", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[1] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[1] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_SCHEM", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[2] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[2] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[3] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[3] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"CLASS_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[4] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[4] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"DATA_TYPE", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[5] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[5] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"REMARKS", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[6] = new HPT4Desc(HPT4Desc.SQLTYPECODE_SMALLINT, (short) 0, 2, (short) 0, (short) 0, false,
+ outputDesc[6] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_SMALLINT, (short) 0, 2, (short) 0, (short) 0, false,
"BASE_TYPE", false, Types.SMALLINT, (short) 0, (short) 0, 0, null, null, null, 130, 0, 0);
resultSet = new TrafT4ResultSet(this, outputDesc, "", true);
@@ -5272,25 +5272,25 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.props_.getLogWriter().println(temp);
}
TrafT4ResultSet resultSet;
- HPT4Desc[] outputDesc;
+ TrafT4Desc[] outputDesc;
ObjectArray[] rows;
clearWarnings();
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
- outputDesc = new HPT4Desc[6];
- outputDesc[0] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc = new TrafT4Desc[6];
+ outputDesc[0] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_CAT", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[1] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[1] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_SCHEM", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[2] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[2] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[3] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[3] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"SUPERTYPE_CAT", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[4] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[4] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"SUPERTYPE_SCHEM", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[5] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[5] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"SUPERTYPE_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
resultSet = new TrafT4ResultSet(this, outputDesc, "", true);
@@ -5317,21 +5317,21 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.props_.getLogWriter().println(temp);
}
TrafT4ResultSet resultSet;
- HPT4Desc[] outputDesc;
+ TrafT4Desc[] outputDesc;
ObjectArray[] rows;
clearWarnings();
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
- outputDesc = new HPT4Desc[4];
- outputDesc[0] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc = new TrafT4Desc[4];
+ outputDesc[0] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_CAT", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[1] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[1] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_SCHEM", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[2] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[2] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[3] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[3] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"SUPERTABLE_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
resultSet = new TrafT4ResultSet(this, outputDesc, "", true);
@@ -5362,55 +5362,55 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.props_.getLogWriter().println(temp);
}
TrafT4ResultSet resultSet;
- HPT4Desc[] outputDesc;
+ TrafT4Desc[] outputDesc;
ObjectArray[] rows;
clearWarnings();
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
- outputDesc = new HPT4Desc[21];
- outputDesc[0] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc = new TrafT4Desc[21];
+ outputDesc[0] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_CAT", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[1] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[1] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_SCHEM", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[2] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[2] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"TYPE_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[3] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[3] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"ATTR_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[4] = new HPT4Desc(HPT4Desc.SQLTYPECODE_SMALLINT, (short) 0, 2, (short) 0, (short) 0, false,
+ outputDesc[4] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_SMALLINT, (short) 0, 2, (short) 0, (short) 0, false,
"DATA_TYPE", false, Types.SMALLINT, (short) 0, (short) 0, 0, null, null, null, 130, 0, 0);
- outputDesc[5] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[5] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"ATTR_TYPE_NAME", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[6] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[6] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"ATTR_SIZE", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[7] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[7] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"DECIMAL_DIGITS ", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[8] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[8] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"NUM_PREC_RADIX", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[9] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[9] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"NULLABLE ", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[10] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[10] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"REMARKS", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[11] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[11] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"ATTR_DEF", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[12] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[12] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"SQL_DATA_TYPE", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[13] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[13] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"SQL_DATETIME_SUB", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[14] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[14] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"CHAR_OCTET_LENGTH", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[15] = new HPT4Desc(HPT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
+ outputDesc[15] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_INTEGER, (short) 0, 4, (short) 0, (short) 0, false,
"ORDINAL_POSITION", false, Types.INTEGER, (short) 0, (short) 0, 0, null, null, null, 132, 0, 0);
- outputDesc[16] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[16] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"IS_NULLABLE", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[17] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[17] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"SCOPE_CATALOG", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[18] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[18] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"SCOPE_SCHEMA", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[19] = new HPT4Desc(HPT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
+ outputDesc[19] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_VARCHAR, (short) 0, 128, (short) 0, (short) 0, false,
"SCOPE_TABLE", false, Types.VARCHAR, (short) 0, (short) 0, 0, null, null, null, 100, 0, 0);
- outputDesc[20] = new HPT4Desc(HPT4Desc.SQLTYPECODE_SMALLINT, (short) 0, 2, (short) 0, (short) 0, false,
+ outputDesc[20] = new TrafT4Desc(TrafT4Desc.SQLTYPECODE_SMALLINT, (short) 0, 2, (short) 0, (short) 0, false,
"SOURCE_DATA_TYPE", false, Types.SMALLINT, (short) 0, (short) 0, 0, null, null, null, 130, 0, 0);
resultSet = new TrafT4ResultSet(this, outputDesc, "", true);
@@ -5747,7 +5747,7 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
// do the warning processing
if (gcr_.m_p4.length != 0) {
- HPT4Messages.setSQLWarning(connection_.props_, this, gcr_.m_p4);
+ TrafT4Messages.setSQLWarning(connection_.props_, this, gcr_.m_p4);
// If there is no description definitions data throw fits. NDCS
// bug.
@@ -5759,11 +5759,11 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
connection_.props_.t4Logger_.logp(Level.FINER, "T4DatabaseMetaData", "getSQLCatalogsInfo",
"SQLDescList null or 0 length", p);
}
- throw HPT4Messages.createSQLException(connection_.props_, ic.getLocale(), "ids_unknown_reply_error",
+ throw TrafT4Messages.createSQLException(connection_.props_, ic.getLocale(), "ids_unknown_reply_error",
"Empty SQL Desc List returned by NDCS");
}
- HPT4Desc[] outputDesc = InterfaceStatement.NewDescArray(gcr_.m_p3);
+ TrafT4Desc[] outputDesc = InterfaceStatement.NewDescArray(gcr_.m_p3);
resultSet_ = new TrafT4ResultSet(this, outputDesc, gcr_.m_p2, true);
resultSet_.proxySyntax_ = gcr_.proxySyntax;
@@ -5779,19 +5779,19 @@ public class T4DatabaseMetaData extends HPT4Handle implements java.sql.DatabaseM
"gcr_.m_p1.exception_nr = odbc_SQLSvc_GetSQLCatalogs_exc_.odbc_SQLSvc_GetSQLCatalogs_SQLError_exn_",
p);
}
- HPT4Messages.throwSQLException(connection_.props_, gcr_.m_p1.SQLError);
+ TrafT4Messages.throwSQLException(connection_.props_, gcr_.m_p1.SQLError);
default:
if (connection_.props_.t4Logger_.isLoggable(Level.FINER) == true) {
Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
connection_.props_.t4Logger_.logp(Level.FINER, "T4DatabaseMetaData", "getSQLCatalogsInfo",
"case gcr_.m_p1.exception_nr default", p);
}
- throw HPT4Messages.createSQLException(connection_.props_, ic.getLocale(), "ids_unknown_reply_error", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, ic.getLocale(), "ids_unknown_reply_error", null);
}
};
- void closeErroredConnection(HPT4Exception sme) {
+ void closeErroredConnection(TrafT4Exception sme) {
if (connection_.props_.t4Logger_.isLoggable(Level.FINER) == true) {
Object p[] = T4LoggingUtilities.makeParams(connection_.props_, sme);
connection_.props_.t4Logger_.logp(Level.FINER, "T4DatabaseMetaData", "closeErroredConneciton", "", p);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Driver.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Driver.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Driver.java
index a1724aa..96ff9b7 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Driver.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Driver.java
@@ -133,11 +133,11 @@ public class T4Driver extends T4Properties implements java.sql.Driver {
}
if (logger.isLoggable(Level.INFO)) {
- logger.entering("HPT4DataSource", "getConnection");
+ logger.entering("TrafT4DataSource", "getConnection");
}
String key = null;
- HPT4DataSource ds = null;
+ TrafT4DataSource ds = null;
if (acceptsURL(url)) {
synchronized(this) {
@@ -165,21 +165,21 @@ public class T4Driver extends T4Properties implements java.sql.Driver {
if (info != null) {
initialize(info);
if (getSQLException() != null) {
- throw HPT4Messages.createSQLException(null, getLocale(), "invalid_property", getSQLException());
+ throw TrafT4Messages.createSQLException(null, getLocale(), "invalid_property", getSQLException());
}
}
if (getMaxPoolSize() != -1) {
key = getUrl() + getCatalog() + getSchema() + getUser() + getPassword() + getServerDataSource()
+ getBlobTableName() + getClobTableName();
- ds = (HPT4DataSource) dsCache_.get(key);
+ ds = (TrafT4DataSource) dsCache_.get(key);
if (ds == null) {
- ds = new HPT4DataSource(getProperties());
+ ds = new TrafT4DataSource(getProperties());
dsCache_.put(key, ds);
}
} else {
- ds = new HPT4DataSource(getProperties());
+ ds = new TrafT4DataSource(getProperties());
}
}
@@ -342,7 +342,7 @@ public class T4Driver extends T4Properties implements java.sql.Driver {
public T4Driver() {
super();
if (logger.isLoggable(Level.INFO)) {
- logger.entering("HPT4DataSource", "getConnection");
+ logger.entering("TrafT4DataSource", "getConnection");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Properties.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Properties.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Properties.java
index 49100b4..917cf45 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Properties.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Properties.java
@@ -45,8 +45,8 @@ import javax.naming.StringRefAddr;
* <p>
* Description: The <code>T4Properties</code> class contains all the
* properties associated with Type 4 connection. <code>T4Properties</code> is
- * inherited directy or indirectly by the <code>T4Driver, HPT4DataSource,
- * HPT4ConnectionPooledDataSource</code>
+ * inherited directy or indirectly by the <code>T4Driver, TrafT4DataSource,
+ * TrafT4ConnectionPooledDataSource</code>
* classes for configuring Type 4 connection properties.
* </p>
* <p>
@@ -262,16 +262,16 @@ public class T4Properties {
t4GlobalLogFileHandler.setFormatter(ff1);
}
} catch (Exception e) {
- // SQLException se = HPT4Messages.createSQLException(null, null,
+ // SQLException se = TrafT4Messages.createSQLException(null, null,
// "problem_with_logging", e.getMessage());
// sqlExceptionMessage_ = se.getMessage();
- SQLException se = HPT4Messages.createSQLException(null, null, "problem_with_logging", e.getMessage());
+ SQLException se = TrafT4Messages.createSQLException(null, null, "problem_with_logging", e.getMessage());
sqlExceptionMessage_ = se.getMessage();
// RuntimeException rte = new RuntimeException(se.getMessage(), se);
// throw rte;
// e.printStackTrace();
- // throw HPT4Messages.createSQLException(null, null,
+ // throw TrafT4Messages.createSQLException(null, null,
// "problem_with_logging", e.getMessage());
}
} // end initializeLogging
@@ -1373,7 +1373,7 @@ public class T4Properties {
t4LogLevel = Level.parse(level);
} catch (Exception ex) {
- SQLException se = HPT4Messages.createSQLException(null, null, "problem_with_logging", ex.getMessage());
+ SQLException se = TrafT4Messages.createSQLException(null, null, "problem_with_logging", ex.getMessage());
sqlExceptionMessage_ = se.getMessage();
// throw se;
// RuntimeException rte = new RuntimeException(se.getMessage(),
@@ -1750,13 +1750,13 @@ public class T4Properties {
count++;
}
if (count < 2) {
- SQLException se = HPT4Messages.createSQLException(null, null, "no_clobTableName", null);
+ SQLException se = TrafT4Messages.createSQLException(null, null, "no_clobTableName", null);
sqlExceptionMessage_ = se.getMessage();
}
clobTableName_ = clobTableName;
} else { // If the name is null, let it be null
clobTableName_ = null;
- // throw HPT4Messages.createSQLException(null,
+ // throw TrafT4Messages.createSQLException(null,
// null,"no_clobTableName",null);
}
}
@@ -1803,7 +1803,7 @@ public class T4Properties {
count++;
}
if (count < 2) {
- SQLException se = HPT4Messages.createSQLException(null, null, "no_blobTableName", null);
+ SQLException se = TrafT4Messages.createSQLException(null, null, "no_blobTableName", null);
sqlExceptionMessage_ = se.getMessage();
}
blobTableName_ = blobTableName;
@@ -1811,7 +1811,7 @@ public class T4Properties {
// If the name is null, then let it be null
else {
blobTableName_ = null;
- // throw HPT4Messages.createSQLException(null, null,
+ // throw TrafT4Messages.createSQLException(null, null,
// "no_blobTableName", null);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4ResultSet.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4ResultSet.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4ResultSet.java
index 45410c7..3ef5970 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4ResultSet.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4ResultSet.java
@@ -82,17 +82,17 @@ final class T4ResultSet extends T4Connection {
catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "FetchMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "fetch_perf_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "fetch_perf_message_error", e
.getMessage());
se.initCause(e);
@@ -128,17 +128,17 @@ final class T4ResultSet extends T4Connection {
catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "CloseMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "close_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "close_message_error", e
.getMessage());
se.initCause(e);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Statement.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Statement.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Statement.java
index c32f3b9..8b86127 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Statement.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Statement.java
@@ -67,17 +67,17 @@ final class T4Statement extends T4Connection {
} catch (SQLException e) {
throw e;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "ExecuteMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "execute_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "execute_message_error", e
.getMessage());
se.initCause(e);
throw se;
@@ -100,7 +100,7 @@ final class T4Statement extends T4Connection {
} catch (SQLException se) {
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "execute_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "execute_message_error", e
.getMessage());
se.initCause(e);
@@ -134,17 +134,17 @@ final class T4Statement extends T4Connection {
} catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "PrepareMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "prepare_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "prepare_message_error", e
.getMessage());
se.initCause(e);
@@ -169,17 +169,17 @@ final class T4Statement extends T4Connection {
} catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "CloseMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "close_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "close_message_error", e
.getMessage());
se.initCause(e);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Cancel.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Cancel.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Cancel.java
index 7357535..ecf50aa 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Cancel.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Cancel.java
@@ -103,7 +103,7 @@ class T4_Dcs_Cancel {
catch (SQLException se) {
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(t4props, locale, "as_cancel_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(t4props, locale, "as_cancel_message_error", e
.getMessage());
se.initCause(e);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Connect.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Connect.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Connect.java
index af94348..60f3497 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Connect.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4_Dcs_Connect.java
@@ -55,8 +55,8 @@ class T4_Dcs_Connect {
Locale locale = ic_.getLocale();
if (inContext == null || userDesc == null) {
- SQLException se = HPT4Messages.createSQLException(t4props, locale, "internal_error", null);
- SQLException se2 = HPT4Messages.createSQLException(t4props, locale, "contact_hp_error", null);
+ SQLException se = TrafT4Messages.createSQLException(t4props, locale, "internal_error", null);
+ SQLException se2 = TrafT4Messages.createSQLException(t4props, locale, "contact_traf_error", null);
se.setNextException(se2);
throw se;
@@ -103,17 +103,17 @@ class T4_Dcs_Connect {
} catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(ic_.t4props_, locale, "translation_of_parameter_failed",
+ SQLException se = TrafT4Messages.createSQLException(ic_.t4props_, locale, "translation_of_parameter_failed",
"ConnectMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(ic_.t4props_, locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(ic_.t4props_, locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(t4props, locale, "as_connect_message_error", e
+ SQLException se = TrafT4Messages.createSQLException(t4props, locale, "as_connect_message_error", e
.getMessage());
se.initCause(e);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4CallableStatement.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4CallableStatement.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4CallableStatement.java
index 2a3675e..8b75f91 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4CallableStatement.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4CallableStatement.java
@@ -64,7 +64,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
connection_.props_.getLogWriter().println(temp);
}
clearWarnings();
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getArray()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getArray()");
return null;
}
@@ -121,7 +121,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
try {
retValue = new BigDecimal(data);
} catch (NumberFormatException e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
return retValue;
@@ -314,11 +314,11 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
validateGetInvocation(parameterIndex);
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.BINARY && dataType != Types.VARBINARY && dataType != Types.LONGVARBINARY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
// BINARY, VARBINARY, LONGVARBINARY not supported
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "datatype_not_supported",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "datatype_not_supported",
null);
}
@@ -364,7 +364,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
// For LOB Support - SB
@@ -383,7 +383,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
retValue = Date.valueOf(dateStr);
}
} catch (IllegalArgumentException e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
return retValue;
@@ -758,7 +758,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
case Types.TIMESTAMP:
return getTimestamp(parameterIndex);
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
}
@@ -778,7 +778,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
String temp = lf.format(lr);
connection_.props_.getLogWriter().println(temp);
}
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getObject()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getObject()");
return null;
}
@@ -835,7 +835,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
String temp = lf.format(lr);
connection_.props_.getLogWriter().println(temp);
}
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getRef()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getRef()");
return null;
}
@@ -950,17 +950,17 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
wasNull_ = false;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(this.connection_.ic_.t4props_, this.connection_
+ SQLException se = TrafT4Messages.createSQLException(this.connection_.ic_.t4props_, this.connection_
.getLocale(), "translation_of_parameter_failed", "getLocalString", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(this.connection_.ic_.t4props_, this.connection_
+ SQLException se = TrafT4Messages.createSQLException(this.connection_.ic_.t4props_, this.connection_
.getLocale(), "unsupported_encoding", e.getCharsetName());
se.initCause(e);
throw se;
} catch (UnsupportedEncodingException e) {
- SQLException se = HPT4Messages.createSQLException(this.connection_.ic_.t4props_, this.connection_
+ SQLException se = TrafT4Messages.createSQLException(this.connection_.ic_.t4props_, this.connection_
.getLocale(), "unsupported_encoding", e.getMessage());
se.initCause(e);
throw se;
@@ -1015,7 +1015,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
@@ -1027,7 +1027,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
wasNull_ = false;
retValue = Time.valueOf(timeStr);
} catch (IllegalArgumentException e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
return retValue;
@@ -1129,7 +1129,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
@@ -1141,7 +1141,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
wasNull_ = false;
retValue = Timestamp.valueOf(timestampStr);
} catch (IllegalArgumentException e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
return retValue;
@@ -1239,7 +1239,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
connection_.props_.getLogWriter().println(temp);
}
clearWarnings();
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getURL()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getURL()");
return null;
}
@@ -1958,7 +1958,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
}
clearWarnings();
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "executeBatch()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "executeBatch()");
return null;
}
@@ -2032,20 +2032,20 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_statement",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_statement",
null);
}
if (inputDesc_ == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"not_a_output_parameter", null);
}
if (parameterIndex < 1 || parameterIndex > inputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_parameter_index", null);
}
if (inputDesc_[parameterIndex - 1].paramMode_ != DatabaseMetaData.procedureColumnInOut
&& inputDesc_[parameterIndex - 1].paramMode_ != DatabaseMetaData.procedureColumnOut) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"not_a_output_parameter", null);
}
}
@@ -2058,11 +2058,11 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
int i;
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_statement",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_statement",
null);
}
if (inputDesc_ == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"not_a_output_parameter", null);
}
for (i = 0; i < inputDesc_.length; i++) {
@@ -2070,7 +2070,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
return i + 1;
}
}
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_parameter_name",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_parameter_name",
null);
}
@@ -2082,10 +2082,10 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
int i;
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "stmt_closed", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "stmt_closed", null);
}
if (inputDesc_ == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_parameter_index", null);
}
for (i = 0; i < inputDesc_.length; i++) {
@@ -2093,7 +2093,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
return i + 1;
}
}
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_parameter_name",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_parameter_name",
null);
}
@@ -2242,7 +2242,7 @@ public class TrafT4CallableStatement extends TrafT4PreparedStatement implements
stmtName, queryTimeout, holdability);
connection_.props_.t4Logger_.logp(Level.FINER, "TrafT4CallableStatement", "cpqPrepareCall", "", p);
}
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "unsupported_feature",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "unsupported_feature",
new Object[] { "cpqPrepareCall" });
};
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
index f1d34f9..a3a004f 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
@@ -79,7 +79,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (this.ic_ == null || this.ic_.isClosed()) {
- throw HPT4Messages.createSQLException(this.props_, this.getLocale(), "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(this.props_, this.getLocale(), "invalid_connection", null);
}
}
@@ -119,7 +119,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
public void resetServerIdleTimer() throws SQLException {
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
this.setConnectionAttr(InterfaceConnection.RESET_IDLE_TIMER, 0, "0");
@@ -480,7 +480,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
@@ -500,7 +500,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
addPreparedStatement(this, sql, stmt, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
holdability_);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -526,13 +526,13 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
if (stmtLabel == null || stmtLabel.length() == 0) {
- throw HPT4Messages.createSQLException(props_, null, "null_data", null);
+ throw TrafT4Messages.createSQLException(props_, null, "null_data", null);
}
if (stmtLabel.startsWith(QUOTE) && stmtLabel.endsWith(QUOTE)) {
int len = stmtLabel.length();
if (len == 2) {
- throw HPT4Messages.createSQLException(props_, null, "null_data", null);
+ throw TrafT4Messages.createSQLException(props_, null, "null_data", null);
} else {
stmtLabel = stmtLabel.substring(1, len - 1);
}
@@ -544,7 +544,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
@@ -564,7 +564,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
addPreparedStatement(this, sql, stmt, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
holdability_);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -590,7 +590,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
@@ -608,7 +608,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
if (isStatementCachingEnabled()) {
addPreparedStatement(this, sql, stmt, resultSetType, resultSetConcurrency, holdability_);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -636,7 +636,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
if (isStatementCachingEnabled()) {
@@ -654,7 +654,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
if (isStatementCachingEnabled()) {
addPreparedStatement(this, sql, stmt, resultSetType, resultSetConcurrency, resultSetHoldability);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -695,13 +695,13 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
if (stmtLabel == null || stmtLabel.length() == 0) {
- throw HPT4Messages.createSQLException(props_, null, "null_data", null);
+ throw TrafT4Messages.createSQLException(props_, null, "null_data", null);
}
if (stmtLabel.startsWith(QUOTE) && stmtLabel.endsWith(QUOTE)) {
int len = stmtLabel.length();
if (len == 2) {
- throw HPT4Messages.createSQLException(props_, null, "null_data", null);
+ throw TrafT4Messages.createSQLException(props_, null, "null_data", null);
} else {
stmtLabel = stmtLabel.substring(1, len - 1);
}
@@ -713,7 +713,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
if (isStatementCachingEnabled()) {
@@ -732,7 +732,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
addPreparedStatement(this, sql, stmt, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
holdability_);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -759,7 +759,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
if (isStatementCachingEnabled()) {
@@ -778,7 +778,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
addPreparedStatement(this, sql, stmt, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY,
holdability_);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -807,13 +807,13 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
stmt = new TrafT4PreparedStatement(this, sql);
stmt.prepare(stmt.sql_, stmt.queryTimeout_, stmt.resultSetHoldability_);
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -840,7 +840,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
if (autoGeneratedKeys == TrafT4Statement.NO_GENERATED_KEYS) {
return prepareStatement(sql);
} else {
- throw HPT4Messages.createSQLException(props_, getLocale(), "auto_generated_keys_not_supported", null);
+ throw TrafT4Messages.createSQLException(props_, getLocale(), "auto_generated_keys_not_supported", null);
}
}
@@ -861,7 +861,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
if (columnIndexes != null && columnIndexes.length > 0) {
- throw HPT4Messages.createSQLException(props_, getLocale(), "auto_generated_keys_not_supported", null);
+ throw TrafT4Messages.createSQLException(props_, getLocale(), "auto_generated_keys_not_supported", null);
} else {
return prepareStatement(sql);
}
@@ -888,7 +888,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
@@ -906,7 +906,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
if (isStatementCachingEnabled()) {
addPreparedStatement(this, sql, stmt, resultSetType, resultSetConcurrency, holdability_);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -934,7 +934,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
@@ -952,7 +952,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
if (isStatementCachingEnabled()) {
addPreparedStatement(this, sql, stmt, resultSetType, resultSetConcurrency, resultSetHoldability);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -975,7 +975,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.getLogWriter().println(temp);
}
if (columnNames != null && columnNames.length > 0) {
- throw HPT4Messages.createSQLException(props_, getLocale(), "auto_generated_keys_not_supported", null);
+ throw TrafT4Messages.createSQLException(props_, getLocale(), "auto_generated_keys_not_supported", null);
} else {
return prepareStatement(sql);
}
@@ -997,7 +997,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.getLogWriter().println(temp);
}
clearWarnings();
- HPT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "releaseSavepoint()");
+ TrafT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "releaseSavepoint()");
}
public void rollback() throws SQLException {
@@ -1017,7 +1017,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
// if (ic_.getTxid() == 0) - XA
@@ -1026,7 +1026,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
// commit the Transaction
try {
ic_.rollback();
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -1049,7 +1049,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.getLogWriter().println(temp);
}
clearWarnings();
- HPT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "rollback(Savepoint)");
+ TrafT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "rollback(Savepoint)");
}
public void setAutoCommit(boolean autoCommit) throws SQLException {
@@ -1070,11 +1070,11 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
ic_.setAutoCommit(this, autoCommit);
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -1097,12 +1097,12 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
if (catalog != null) {
try {
ic_.setCatalog(this, catalog);
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -1126,13 +1126,13 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
if (holdability != TrafT4ResultSet.CLOSE_CURSORS_AT_COMMIT)
{
- throw HPT4Messages.createSQLException(props_, getLocale(), "invalid_holdability", null);
+ throw TrafT4Messages.createSQLException(props_, getLocale(), "invalid_holdability", null);
}
holdability_ = holdability;
}
@@ -1154,12 +1154,12 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
// ic_.setReadOnly(readOnly);
ic_.setReadOnly(this, readOnly);
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -1197,7 +1197,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.getLogWriter().println(temp);
}
clearWarnings();
- HPT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "setSavepoint");
+ TrafT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "setSavepoint");
return null;
}
@@ -1217,7 +1217,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.getLogWriter().println(temp);
}
clearWarnings();
- HPT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "setSavepoint");
+ TrafT4Messages.throwUnsupportedFeatureException(props_, getLocale(), "setSavepoint");
return null;
}
@@ -1238,11 +1238,11 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
clearWarnings();
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
ic_.setTransactionIsolation(this, level);
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -1284,7 +1284,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.getLogWriter().println(temp);
}
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
try {
ic_.beginTransaction();
@@ -1294,7 +1294,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
} else {
setAutoCommit(false);
}
- } catch (HPT4Exception se) {
+ } catch (TrafT4Exception se) {
performConnectionErrorChecks(se);
throw se;
}
@@ -1316,7 +1316,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.getLogWriter().println(temp);
}
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
return ic_.getTxid();
}
@@ -1331,7 +1331,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
props_.t4Logger_.logp(Level.FINER, "TrafT4Connection", "setTxid", "", p);
}
if (_isClosed() == true) {
- throw HPT4Messages.createSQLException(props_, null, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(props_, null, "invalid_connection", null);
}
transactionToJoin = txid;
@@ -1506,7 +1506,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
ic_.reuse();
/*
- * try { ic_.enforceT4ConnectionTimeout(this); } catch (HPT4Exception
+ * try { ic_.enforceT4ConnectionTimeout(this); } catch (TrafT4Exception
* se) { //performConnectionErrorChecks(se); //throw se; //ignore - new
* property from old MXCS ABD version (now known as NCS) //ignored for
* backward compatibility }
@@ -1534,11 +1534,11 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
if (pc_ != null) {
return pc_;
} else {
- throw HPT4Messages.createSQLException(props_, getLocale(), "null_pooled_connection", null);
+ throw TrafT4Messages.createSQLException(props_, getLocale(), "null_pooled_connection", null);
}
}
- TrafT4Connection(HPT4DataSource ds, T4Properties t4props) throws SQLException {
+ TrafT4Connection(TrafT4DataSource ds, T4Properties t4props) throws SQLException {
super(t4props);
t4props.setConnectionID(Integer.toString(this.hashCode()));
@@ -1565,7 +1565,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
holdability_ = TrafT4ResultSet.CLOSE_CURSORS_AT_COMMIT;
}
- TrafT4Connection(HPT4PooledConnection poolConn, T4Properties t4props) throws SQLException {
+ TrafT4Connection(TrafT4PooledConnection poolConn, T4Properties t4props) throws SQLException {
super(t4props);
t4props.setConnectionID(Integer.toString(this.hashCode()));
@@ -1769,7 +1769,7 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
}
- void closeErroredConnection(HPT4Exception se) {
+ void closeErroredConnection(TrafT4Exception se) {
try {
if (!erroredConnection) { // don't issue close repeatedly
erroredConnection = true;
@@ -1829,8 +1829,8 @@ public class TrafT4Connection extends PreparedStatementManager implements java.s
Hashtable refToStmt_;
Hashtable refToRS_;
int holdability_;
- HPT4DataSource ds_;
- HPT4PooledConnection pc_;
+ TrafT4DataSource ds_;
+ TrafT4PooledConnection pc_;
T4Driver driver_;
WeakReference pRef_;
T4Properties props_;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSource.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSource.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSource.java
new file mode 100644
index 0000000..06eb666
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSource.java
@@ -0,0 +1,346 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.Properties;
+import java.util.logging.FileHandler;
+import java.util.logging.Formatter;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import javax.naming.StringRefAddr;
+import javax.sql.PooledConnection;
+
+/**
+ *
+ * <p>
+ * JDBC Type 4 Driver <code>ConnectionPoolDataSource</code> class.
+ * </p>
+ * <p>
+ * Description: A <code>ConnectionPoolDataSource</code> object is a factory
+ * for <code>PooledConnection</code> objects. As the name indicates, this
+ * object provides a <code>PooledConnection</code> for data sources to be used
+ * by the application servers.
+ * </p>
+ *
+ * <p>
+ * The <code>TrafT4ConnectionPoolDataSource</code> class should be used to
+ * provide JDBC3.0 connection pooling features. The
+ * <code>TrafT4ConnectionPoolDataSource</code> is used by the application
+ * servers like WSAS to provide connection pooling features to the J2EE
+ * applications. <code>TrafT4ConnectionPoolDataSource.getPooledConnection()</code>
+ * returns the <code>javax.sql.PooledConnection object</code>.
+ * </p>
+ *
+ *
+ * Setting connection properties such as catalog, schema, timeouts, and so on
+ * are done at the higher level objects such as DataSource or DriverManager.
+ *
+ * <p>
+ * Licensed to the Apache Software Foundation (ASF)
+ * </p>
+ *
+ * @see T4Properties
+ * @see TrafT4DataSource
+ */
+
+public class TrafT4ConnectionPoolDataSource extends T4DSProperties implements javax.sql.ConnectionPoolDataSource,
+ java.io.Serializable, Referenceable
+
+{
+
+ /**
+ * Attempts to establish a physical database connection that can be used as
+ * a pooled connection.
+ *
+ * @return A <code>PooledConnection</code> object that is a physical
+ * connection to the NDCS server that this
+ * <code>TrafT4ConnectionPoolDataSource</code> object represents.
+ * @throws SQLException
+ * If any NDCS error occurs.
+ */
+ public PooledConnection getPooledConnection() throws SQLException {
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ t4Logger_.logp(Level.FINE, "TrafT4ConnectionPoolDataSource", "getPooledConnection", "", p);
+ }
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4ConnectionPoolDataSource");
+ lr.setSourceMethodName("getPooledConnection");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ TrafT4PooledConnection connect;
+
+ Properties l_props = super.getProperties();
+ T4Properties l_t4props = new T4Properties(l_props);
+ connect = new TrafT4PooledConnection(this, l_t4props);
+
+ return connect;
+ }
+
+ /**
+ * Attempts to establish a physical database connection that can be used as
+ * a pooled connection.
+ *
+ * @param username
+ * Safeguard user name.
+ * @param password
+ * Safeguard user password.
+ * @return A <code>PooledConnection</code> object that is a physical
+ * connection to the NDCS server that this
+ * <code>TrafT4ConnectionPoolDataSource</code> object represents.
+ * @throws SQLException
+ * If any NDCS error occurs.
+ */
+ public PooledConnection getPooledConnection(String username, String password) throws SQLException {
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null, username);
+ t4Logger_.logp(Level.FINE, "TrafT4ConnectionPoolDataSource", "getPooledConnection", "", p);
+ }
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null, username);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4ConnectionPoolDataSource");
+ lr.setSourceMethodName("getPooledConnection");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ TrafT4PooledConnection connect;
+
+ setUser(username);
+ setPassword(password);
+ return getPooledConnection();
+
+ }
+
+ /**
+ * Returns all the properties associated with this
+ * <code>ConnectionPoolDataSource</code>.
+ *
+ * @return Reference Object containing all the Type 4 property references.
+ * @throws NamingException
+ */
+ public Reference getReference() throws NamingException {
+ if (t4Logger_ != null && t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ t4Logger_.logp(Level.FINE, "TrafT4ConnectionPoolDataSource", "getReference", "", p);
+ }
+ try {
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4ConnectionPoolDataSource");
+ lr.setSourceMethodName("getReference");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+
+ Reference ref = new Reference(this.getClass().getName(), "org.trafodion.jdbc.t4.TrafT4ConnectionPoolDataSourceFactory",
+ null);
+ ref = addReferences(ref);
+ ref.add(new StringRefAddr("propertyCycle", Integer.toString(propertyCycle_)));
+ return ref;
+
+ }
+
+ /**
+ * Sets the Property cycle property. This property is not supprted by the
+ * Type 4 driver. This property is ignored by the Type 4 driver.
+ *
+ * @param propertyCycle
+ */
+ public void setPropertyCycle(int propertyCycle) {
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ t4Logger_.logp(Level.FINE, "TrafT4ConnectionPoolDataSource", "setPropertyCycle", "", p);
+ }
+ try {
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null, propertyCycle);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4ConnectionPoolDataSource");
+ lr.setSourceMethodName("setPropertyCycle");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ propertyCycle_ = propertyCycle;
+ }
+
+ /**
+ * Returns the Property cycle property. This property is not supprted by the
+ * Type 4 driver. This property is ignored by the Type 4 driver.
+ *
+ * @return propertyCycle
+ */
+ public int getPropertyCycle() {
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ t4Logger_.logp(Level.FINE, "TrafT4ConnectionPoolDataSource", "getPropertyCycle", "", p);
+ }
+ try {
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4ConnectionPoolDataSource");
+ lr.setSourceMethodName("getPropertyCycle");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ return propertyCycle_;
+ }
+
+ // --------------------------------------------------------
+ void setupLogFileHandler() {
+ try {
+ if (getT4LogFile() == null) {
+ setT4LogFile(getT4GlobalLogFile());
+ setT4LogFileHandler(getT4GlobalLogFileHandler());
+ } else {
+ if (getT4LogFileHandler() == null) {
+ String temp = getT4LogFile();
+ FileHandler fh1 = new FileHandler(temp);
+ Formatter ff1 = new T4LogFormatter();
+
+ fh1.setFormatter(ff1);
+ setT4LogFileHandler(fh1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } // end setupLogFileHandler
+
+ // --------------------------------------------------------
+
+ /**
+ * Creates a pooled connection object.
+ *
+ * @see #TrafT4ConnectionPoolDataSource(Properties)
+ * @see T4Properties
+ */
+ public TrafT4ConnectionPoolDataSource() {
+ super();
+ if (getT4LogLevel() != Level.OFF)
+ setupLogFileHandler();
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ t4Logger_.logp(Level.FINE, "TrafT4ConnectionPoolDataSource", "TrafT4ConnectionPoolDataSource",
+ "Note, super called before this.", p);
+ }
+ try {
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4ConnectionPoolDataSource");
+ lr.setSourceMethodName("");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ }
+
+ /**
+ * Creates a pooled connection object with the properties specified.
+ *
+ * @param props
+ * properties for the Type 4 connection
+ * @see #TrafT4ConnectionPoolDataSource()
+ * @link T4Properties
+ */
+ public TrafT4ConnectionPoolDataSource(Properties props) {
+ super(props);
+ if (getT4LogLevel() != Level.OFF)
+ setupLogFileHandler();
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null, props);
+ t4Logger_.logp(Level.FINE, "TrafT4ConnectionPoolDataSource", "TrafT4ConnectionPoolDataSource",
+ "Note, super called before this.", p);
+ }
+ try {
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null, props);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4ConnectionPoolDataSource");
+ lr.setSourceMethodName("");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ }
+
+ /**
+ * @deprecated
+ */
+ public void setNameType(String nameType) {
+ }
+
+ /**
+ * @deprecated
+ */
+ public String getNameType() {
+ return null;
+ }
+
+ // Standard ConnectionPoolDataSource Properties
+ int propertyCycle_;
+
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSourceFactory.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSourceFactory.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSourceFactory.java
new file mode 100644
index 0000000..0523769
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ConnectionPoolDataSourceFactory.java
@@ -0,0 +1,68 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+
+public class TrafT4ConnectionPoolDataSourceFactory implements javax.naming.spi.ObjectFactory {
+ public TrafT4ConnectionPoolDataSourceFactory() {
+ }
+
+ public Object getObjectInstance(Object refobj, Name name, Context nameCtx, Hashtable env) throws Exception {
+ Reference ref = (Reference) refobj;
+ TrafT4ConnectionPoolDataSource ds;
+ RefAddr refAddr;
+ String tmp;
+
+ if (ref.getClassName().equals("org.trafodion.jdbc.t4.TrafT4ConnectionPoolDataSource")) {
+ Properties props = new Properties();
+ for (Enumeration enum2 = ref.getAll(); enum2.hasMoreElements();) {
+ RefAddr tRefAddr = (RefAddr) enum2.nextElement();
+ String type = tRefAddr.getType();
+ String content = (String) tRefAddr.getContent();
+ props.setProperty(type, content);
+ }
+ ds = new TrafT4ConnectionPoolDataSource(props);
+ /*
+ * tmp = props.getProperty("initialPoolSize"); if (tmp != null) {
+ * try { ds.setInitialPoolSize(Integer.parseInt(tmp)); } catch
+ * (NumberFormatException e1) { } } tmp =
+ * props.getProperty("maxIdleTime"); if (tmp != null) { try {
+ * ds.setMaxIdleTime(Integer.parseInt(tmp)); } catch
+ * (NumberFormatException e4) { } } tmp =
+ * props.getProperty("propertyCycle"); if (tmp != null) { try {
+ * ds.setPropertyCycle(Integer.parseInt(tmp)); } catch
+ * (NumberFormatException e5) { } }
+ */
+ return ds;
+ } else {
+ return null;
+ }
+ }
+}
[6/9] incubator-trafodion git commit: Rename required prefix with Traf
Posted by db...@apache.org.
Rename required prefix with Traf
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/38e49cf7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/38e49cf7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/38e49cf7
Branch: refs/heads/master
Commit: 38e49cf712cac614349c024af5125955101abb10
Parents: dcfc8e6
Author: Kevin Xu <ka...@esgyn.cn>
Authored: Fri May 13 15:41:52 2016 +0800
Committer: Kevin Xu <ka...@esgyn.cn>
Committed: Fri May 13 15:41:52 2016 +0800
----------------------------------------------------------------------
.../jdbcT4/src/main/java/T4Messages.properties | 6 +-
.../java/org/trafodion/jdbc/t4/Address.java | 2 +-
.../jdbc/t4/HPT4ConnectionPoolDataSource.java | 346 ------------
.../t4/HPT4ConnectionPoolDataSourceFactory.java | 68 ---
.../org/trafodion/jdbc/t4/HPT4DataSource.java | 366 -------------
.../jdbc/t4/HPT4DataSourceFactory.java | 62 ---
.../java/org/trafodion/jdbc/t4/HPT4Desc.java | 542 -------------------
.../org/trafodion/jdbc/t4/HPT4Exception.java | 38 --
.../java/org/trafodion/jdbc/t4/HPT4Handle.java | 84 ---
.../org/trafodion/jdbc/t4/HPT4Messages.java | 324 -----------
.../jdbc/t4/HPT4ParameterMetaData.java | 243 ---------
.../trafodion/jdbc/t4/HPT4PooledConnection.java | 238 --------
.../jdbc/t4/HPT4PooledConnectionManager.java | 385 -------------
.../jdbc/t4/HPT4ResultSetMetaData.java | 309 -----------
.../jdbc/t4/InitializeDialogueReply.java | 6 +-
.../java/org/trafodion/jdbc/t4/InputOutput.java | 50 +-
.../trafodion/jdbc/t4/InterfaceConnection.java | 52 +-
.../trafodion/jdbc/t4/InterfaceResultSet.java | 34 +-
.../trafodion/jdbc/t4/InterfaceStatement.java | 148 ++---
.../java/org/trafodion/jdbc/t4/NCSAddress.java | 22 +-
.../jdbc/t4/PreparedStatementManager.java | 2 +-
.../java/org/trafodion/jdbc/t4/T4Address.java | 24 +-
.../org/trafodion/jdbc/t4/T4Connection.java | 36 +-
.../org/trafodion/jdbc/t4/T4DSProperties.java | 6 +-
.../trafodion/jdbc/t4/T4DatabaseMetaData.java | 132 ++---
.../java/org/trafodion/jdbc/t4/T4Driver.java | 14 +-
.../org/trafodion/jdbc/t4/T4Properties.java | 20 +-
.../java/org/trafodion/jdbc/t4/T4ResultSet.java | 12 +-
.../java/org/trafodion/jdbc/t4/T4Statement.java | 20 +-
.../org/trafodion/jdbc/t4/T4_Dcs_Cancel.java | 2 +-
.../org/trafodion/jdbc/t4/T4_Dcs_Connect.java | 10 +-
.../jdbc/t4/TrafT4CallableStatement.java | 58 +-
.../org/trafodion/jdbc/t4/TrafT4Connection.java | 108 ++--
.../jdbc/t4/TrafT4ConnectionPoolDataSource.java | 346 ++++++++++++
.../TrafT4ConnectionPoolDataSourceFactory.java | 68 +++
.../org/trafodion/jdbc/t4/TrafT4DataSource.java | 366 +++++++++++++
.../jdbc/t4/TrafT4DataSourceFactory.java | 62 +++
.../java/org/trafodion/jdbc/t4/TrafT4Desc.java | 542 +++++++++++++++++++
.../org/trafodion/jdbc/t4/TrafT4Exception.java | 38 ++
.../org/trafodion/jdbc/t4/TrafT4Handle.java | 84 +++
.../org/trafodion/jdbc/t4/TrafT4Messages.java | 324 +++++++++++
.../jdbc/t4/TrafT4ParameterMetaData.java | 243 +++++++++
.../jdbc/t4/TrafT4PooledConnection.java | 238 ++++++++
.../jdbc/t4/TrafT4PooledConnectionManager.java | 385 +++++++++++++
.../jdbc/t4/TrafT4PreparedStatement.java | 118 ++--
.../org/trafodion/jdbc/t4/TrafT4ResultSet.java | 296 +++++-----
.../jdbc/t4/TrafT4ResultSetMetaData.java | 309 +++++++++++
.../org/trafodion/jdbc/t4/TrafT4Statement.java | 70 +--
.../java/org/trafodion/jdbc/t4/Utility.java | 24 +-
.../jdbc/t4/odbc_Dcs_GetObjRefHdl_exc_.java | 16 +-
.../jdbc/t4/odbc_Dcs_StopSrvr_exc_.java | 8 +-
.../jdbc/t4/odbc_SQLSvc_Close_exc_.java | 8 +-
.../t4/odbc_SQLSvc_EndTransaction_exc_.java | 8 +-
.../jdbc/t4/odbc_SQLSvc_Execute_exc_.java | 10 +-
.../jdbc/t4/odbc_SQLSvc_Fetch_exc_.java | 10 +-
.../t4/odbc_SQLSvc_GetSQLCatalogs_exc_.java | 6 +-
.../t4/odbc_SQLSvc_InitializeDialogue_exc_.java | 6 +-
.../jdbc/t4/odbc_SQLSvc_Prepare_exc_.java | 10 +-
.../odbc_SQLSvc_SetConnectionOption_exc_.java | 12 +-
.../t4/odbc_SQLSvc_TerminateDialogue_exc_.java | 8 +-
.../java/org/trafodion/jdbc/t4/RunAllTests.java | 2 +
.../org/trafodion/rest/util/JdbcT4Util.java | 6 +-
62 files changed, 3697 insertions(+), 3695 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/T4Messages.properties
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/T4Messages.properties b/core/conn/jdbcT4/src/main/java/T4Messages.properties
index 24d6fb1..b5abf23 100644
--- a/core/conn/jdbcT4/src/main/java/T4Messages.properties
+++ b/core/conn/jdbcT4/src/main/java/T4Messages.properties
@@ -268,9 +268,9 @@ internal_error_msg=An internal error occurred
internal_error_sqlstate=HY000
internal_error_sqlcode=29100
-contact_hp_error_msg=Contact your service provider
-contact_hp_error_sqlstate=HY000
-contact_hp_error_sqlcode=29101
+contact_traf_error_msg=Contact your service provider
+contact_traf_error_sqlstate=HY000
+contact_traf_error_sqlcode=29101
address_parsing_error_msg=Error while parsing address {0}
address_parsing_error_sqlstate=HY000
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Address.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Address.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Address.java
index d486f57..d7f106f 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Address.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/Address.java
@@ -94,7 +94,7 @@ abstract class Address {
try {
m_inetAddrs = InetAddress.getAllByName(IPorName);
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_lookup_error", m_url, e
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_lookup_error", m_url, e
.getMessage());
se.initCause(e);
throw se;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSource.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSource.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSource.java
deleted file mode 100644
index 39e39dd..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSource.java
+++ /dev/null
@@ -1,346 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
-import java.util.Properties;
-import java.util.logging.FileHandler;
-import java.util.logging.Formatter;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-import javax.sql.PooledConnection;
-
-/**
- *
- * <p>
- * JDBC Type 4 Driver <code>ConnectionPoolDataSource</code> class.
- * </p>
- * <p>
- * Description: A <code>ConnectionPoolDataSource</code> object is a factory
- * for <code>PooledConnection</code> objects. As the name indicates, this
- * object provides a <code>PooledConnection</code> for data sources to be used
- * by the application servers.
- * </p>
- *
- * <p>
- * The <code>HPT4ConnectionPoolDataSource</code> class should be used to
- * provide JDBC3.0 connection pooling features. The
- * <code>HPT4ConnectionPoolDataSource</code> is used by the application
- * servers like WSAS to provide connection pooling features to the J2EE
- * applications. <code>HPT4ConnectionPoolDataSource.getPooledConnection()</code>
- * returns the <code>javax.sql.PooledConnection object</code>.
- * </p>
- *
- *
- * Setting connection properties such as catalog, schema, timeouts, and so on
- * are done at the higher level objects such as DataSource or DriverManager.
- *
- * <p>
- * Licensed to the Apache Software Foundation (ASF)
- * </p>
- *
- * @see T4Properties
- * @see HPT4DataSource
- */
-
-public class HPT4ConnectionPoolDataSource extends T4DSProperties implements javax.sql.ConnectionPoolDataSource,
- java.io.Serializable, Referenceable
-
-{
-
- /**
- * Attempts to establish a physical database connection that can be used as
- * a pooled connection.
- *
- * @return A <code>PooledConnection</code> object that is a physical
- * connection to the NDCS server that this
- * <code>HPT4ConnectionPoolDataSource</code> object represents.
- * @throws SQLException
- * If any NDCS error occurs.
- */
- public PooledConnection getPooledConnection() throws SQLException {
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null);
- t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getPooledConnection", "", p);
- }
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4ConnectionPoolDataSource");
- lr.setSourceMethodName("getPooledConnection");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- HPT4PooledConnection connect;
-
- Properties l_props = super.getProperties();
- T4Properties l_t4props = new T4Properties(l_props);
- connect = new HPT4PooledConnection(this, l_t4props);
-
- return connect;
- }
-
- /**
- * Attempts to establish a physical database connection that can be used as
- * a pooled connection.
- *
- * @param username
- * Safeguard user name.
- * @param password
- * Safeguard user password.
- * @return A <code>PooledConnection</code> object that is a physical
- * connection to the NDCS server that this
- * <code>HPT4ConnectionPoolDataSource</code> object represents.
- * @throws SQLException
- * If any NDCS error occurs.
- */
- public PooledConnection getPooledConnection(String username, String password) throws SQLException {
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null, username);
- t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getPooledConnection", "", p);
- }
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null, username);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4ConnectionPoolDataSource");
- lr.setSourceMethodName("getPooledConnection");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- HPT4PooledConnection connect;
-
- setUser(username);
- setPassword(password);
- return getPooledConnection();
-
- }
-
- /**
- * Returns all the properties associated with this
- * <code>ConnectionPoolDataSource</code>.
- *
- * @return Reference Object containing all the Type 4 property references.
- * @throws NamingException
- */
- public Reference getReference() throws NamingException {
- if (t4Logger_ != null && t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null);
- t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getReference", "", p);
- }
- try {
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4ConnectionPoolDataSource");
- lr.setSourceMethodName("getReference");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
-
- Reference ref = new Reference(this.getClass().getName(), "org.trafodion.jdbc.t4.HPT4ConnectionPoolDataSourceFactory",
- null);
- ref = addReferences(ref);
- ref.add(new StringRefAddr("propertyCycle", Integer.toString(propertyCycle_)));
- return ref;
-
- }
-
- /**
- * Sets the Property cycle property. This property is not supprted by the
- * Type 4 driver. This property is ignored by the Type 4 driver.
- *
- * @param propertyCycle
- */
- public void setPropertyCycle(int propertyCycle) {
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null);
- t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "setPropertyCycle", "", p);
- }
- try {
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null, propertyCycle);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4ConnectionPoolDataSource");
- lr.setSourceMethodName("setPropertyCycle");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- propertyCycle_ = propertyCycle;
- }
-
- /**
- * Returns the Property cycle property. This property is not supprted by the
- * Type 4 driver. This property is ignored by the Type 4 driver.
- *
- * @return propertyCycle
- */
- public int getPropertyCycle() {
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null);
- t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "getPropertyCycle", "", p);
- }
- try {
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4ConnectionPoolDataSource");
- lr.setSourceMethodName("getPropertyCycle");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- return propertyCycle_;
- }
-
- // --------------------------------------------------------
- void setupLogFileHandler() {
- try {
- if (getT4LogFile() == null) {
- setT4LogFile(getT4GlobalLogFile());
- setT4LogFileHandler(getT4GlobalLogFileHandler());
- } else {
- if (getT4LogFileHandler() == null) {
- String temp = getT4LogFile();
- FileHandler fh1 = new FileHandler(temp);
- Formatter ff1 = new T4LogFormatter();
-
- fh1.setFormatter(ff1);
- setT4LogFileHandler(fh1);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- } // end setupLogFileHandler
-
- // --------------------------------------------------------
-
- /**
- * Creates a pooled connection object.
- *
- * @see #HPT4ConnectionPoolDataSource(Properties)
- * @see T4Properties
- */
- public HPT4ConnectionPoolDataSource() {
- super();
- if (getT4LogLevel() != Level.OFF)
- setupLogFileHandler();
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null);
- t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "HPT4ConnectionPoolDataSource",
- "Note, super called before this.", p);
- }
- try {
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4ConnectionPoolDataSource");
- lr.setSourceMethodName("");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- }
-
- /**
- * Creates a pooled connection object with the properties specified.
- *
- * @param props
- * properties for the Type 4 connection
- * @see #HPT4ConnectionPoolDataSource()
- * @link T4Properties
- */
- public HPT4ConnectionPoolDataSource(Properties props) {
- super(props);
- if (getT4LogLevel() != Level.OFF)
- setupLogFileHandler();
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null, props);
- t4Logger_.logp(Level.FINE, "HPT4ConnectionPoolDataSource", "HPT4ConnectionPoolDataSource",
- "Note, super called before this.", p);
- }
- try {
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null, props);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4ConnectionPoolDataSource");
- lr.setSourceMethodName("");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- }
-
- /**
- * @deprecated
- */
- public void setNameType(String nameType) {
- }
-
- /**
- * @deprecated
- */
- public String getNameType() {
- return null;
- }
-
- // Standard ConnectionPoolDataSource Properties
- int propertyCycle_;
-
- public Logger getParentLogger() throws SQLFeatureNotSupportedException {
- // TODO Auto-generated method stub
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSourceFactory.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSourceFactory.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSourceFactory.java
deleted file mode 100644
index 3f87539..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ConnectionPoolDataSourceFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-
-public class HPT4ConnectionPoolDataSourceFactory implements javax.naming.spi.ObjectFactory {
- public HPT4ConnectionPoolDataSourceFactory() {
- }
-
- public Object getObjectInstance(Object refobj, Name name, Context nameCtx, Hashtable env) throws Exception {
- Reference ref = (Reference) refobj;
- HPT4ConnectionPoolDataSource ds;
- RefAddr refAddr;
- String tmp;
-
- if (ref.getClassName().equals("org.trafodion.jdbc.t4.HPT4ConnectionPoolDataSource")) {
- Properties props = new Properties();
- for (Enumeration enum2 = ref.getAll(); enum2.hasMoreElements();) {
- RefAddr tRefAddr = (RefAddr) enum2.nextElement();
- String type = tRefAddr.getType();
- String content = (String) tRefAddr.getContent();
- props.setProperty(type, content);
- }
- ds = new HPT4ConnectionPoolDataSource(props);
- /*
- * tmp = props.getProperty("initialPoolSize"); if (tmp != null) {
- * try { ds.setInitialPoolSize(Integer.parseInt(tmp)); } catch
- * (NumberFormatException e1) { } } tmp =
- * props.getProperty("maxIdleTime"); if (tmp != null) { try {
- * ds.setMaxIdleTime(Integer.parseInt(tmp)); } catch
- * (NumberFormatException e4) { } } tmp =
- * props.getProperty("propertyCycle"); if (tmp != null) { try {
- * ds.setPropertyCycle(Integer.parseInt(tmp)); } catch
- * (NumberFormatException e5) { } }
- */
- return ds;
- } else {
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSource.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSource.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSource.java
deleted file mode 100644
index f0e0c8f..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSource.java
+++ /dev/null
@@ -1,366 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.SQLFeatureNotSupportedException;
-import java.util.Properties;
-import java.util.logging.FileHandler;
-import java.util.logging.Formatter;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-import java.util.logging.Logger;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-
-/**
- *
- * <p>
- * JDBC Type 4 Driver <code>DataSource</code> class.
- * </p>
- * <p>
- * Description: A <code>DataSource</code> object is a factory for Connection
- * objects. An object that implements the <code>DataSource</code> interface is
- * typically registered with a JNDI service provider. A JDBC driver that is
- * accessed through the <code>DataSource</code> API does not automatically
- * register itself with the <code>DriverManager</code> object.
- * </p>
- *
- * <p>
- * The <code>HPT4DataSource</code> class can provide connection pooling and
- * statement pooling features.
- * </p>
- *
- * <pre>
- * <b>Setting properties for the HPT4DataSource in the Type 4 driver</b>
- * HPT4DataSource ds = new HPT4DataSource();
- * ds.setUrl("jdbc:t4jdbc://<NDCS host>:<NDCS port>/:");
- * ds.setCatalog("your catalog");
- * ds.setSchema("your schema");
- * ds.setUser("safeguard user name");
- * ds.setPassword("safeguard password");
- *
- * // Following are optional properties
- * ds.setConnectionTimeout("timeout in seconds");
- * ds.setT4LogFile("your log file location");
- * ds.setT4LogLevel("SEVERE");
- * ds.setServerDataSource("NDCS datasource name");
- *
- * // Properties relevant for Type 4 connection pooling.
- * // Set ds.setMaxPoolSize(-1) to turn OFF connection pooling
- * ds.setMaxPoolSize("number of connections required");
- * ds.setMinPoolSize("number of connections required");
- *
- * // Properties relevant for Type 4 statement pooling.
- * // Set ds.setMaxStatement(0) to turn statement pooling OFF
- * // Statement pooling is enabled only when connection pooling is enabled.
- * ds.setMaxStatements("number of statements to be pooled");
- * </pre>
- *
- * <pre>
- * <b>Programmatically registering HPT4DataSource with JDNI</b>
- * java.util.Hashtable env = new java.util.Hashtable();
- * env.put(Context.INITIAL_CONTEXT_FACTORY, "Factory class name here");
- * javax.naming.Context ctx = new javax.naming.InitialContext(env);
- * ctx.rebind("DataSource name here", ds);
- * </pre>
- *
- * <pre>
- * <b>Application making Type4 connection using the DataSource from JDNI</b>
- * java.util.Hashtable env = new java.util.Hashtable();
- * env.put(Context.INITIAL_CONTEXT_FACTORY, "Factory class name here");
- * javax.naming.Context ctx = new javax.naming.InitialContext(env);
- * DataSource ds = (DataSource)ctx.lookup("DataSource name here");
- * java.sql.Connection con = ds.getConnection();
- * </pre>
- *
- * <p>
- * Copyright: (C) Apache Software Foundation (ASF)
- * </p>
- *
- * @see T4Properties
- */
-public class HPT4DataSource extends T4DSProperties implements javax.sql.DataSource, java.io.Serializable, Referenceable
-
-{
- /**
- * Attempts to establish an NDCS connection.
- *
- * @return a connection to the NDCS server.
- * @throws SQLException
- * if a database access error or NDCS error occurs.
- * @see #getConnection(String, String)
- */
- synchronized public Connection getConnection() throws SQLException {
- if (logger.isLoggable(Level.FINER)) {
- logger.entering("HPT4DataSource", "getConnection");
- }
-
- Connection conn;
- TrafT4Connection t4Conn;
- HPT4ConnectionPoolDataSource pds;
-
- if (getSQLException() != null) {
- throw HPT4Messages.createSQLException(null, getLocale(), "invalid_property", getSQLException());
- }
-
- if (getMaxPoolSize() == -1) {
- t4Conn = new TrafT4Connection(this, getT4Properties());
- } else {
- if (poolManager != null) {
- t4Conn = (TrafT4Connection) poolManager.getConnection();
- } else {
-
- pds = new HPT4ConnectionPoolDataSource(getProperties());
- poolManager = new HPT4PooledConnectionManager(pds, getT4LogLevel());
- t4Conn = (TrafT4Connection) poolManager.getConnection();
- }
- }
-
- t4Conn.setLogInfo(getT4LogLevel(), getLogWriter());
- conn = t4Conn;
-
- if (logger.isLoggable(Level.FINER)) {
- logger.exiting("HPT4DataSource", "getConnection", conn);
- }
-
- return conn;
- }
-
- /**
- * Attempts to establish an NDCS connection.
- *
- * @return a connection to the NDCS server.
- * @param username
- * Safeguard user name
- * @param password
- * Safeguard user password
- * @throws SQLException
- * if a database access error or NDCS error occurs.
- * @see #getConnection()
- */
- synchronized public Connection getConnection(String username, String password) throws SQLException {
- if (logger.isLoggable(Level.FINER)) {
- logger.entering("HPT4DataSource", "getConnection", new Object[] { this, username });
- }
-
- Connection conn;
-
- setUser(username);
- setPassword(password);
-
- conn = getConnection();
-
- if (logger.isLoggable(Level.FINER)) {
- logger.exiting("HPT4DataSource", "getConnection", conn);
- }
-
- return conn;
- }
-
- /**
- * @return Reference Object containing all the Type 4 property references.
- * @throws NamingException
- */
- public Reference getReference() throws NamingException {
-
- Reference ref = new Reference(this.getClass().getName(), "org.trafodion.jdbc.t4.HPT4DataSourceFactory", null);
- return addReferences(ref);
- }
-
- /**
- * Sets the print writer for the current Type 4 data source.
- *
- * @param out
- * java.io.PrintWriter for the current T4 connection.
- * @throws SQLException
- * when error occurs.
- * @see #getLogWriter()
- * @see javax.sql.ConnectionPoolDataSource
- */
- public void setLogWriter(PrintWriter out) throws SQLException {
- super.setLogWriter(out);
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null, out);
- t4Logger_.logp(Level.FINE, "HPT4DataSource", "setLogWriter",
- "Note, this constructor was called before the previous constructor", p);
- }
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null, out);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4DataSource");
- lr.setSourceMethodName("setLogWriter");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- if (poolManager != null) {
- poolManager.setLogWriter(getLogWriter());
- }
- }
-
- // Local methods
- void setPoolManager(Context nameCtx, String dataSourceName) throws Exception {
- if (t4Logger_.isLoggable(Level.FINER) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null, nameCtx, dataSourceName);
- t4Logger_.logp(Level.FINER, "HPT4DataSource", "setPoolManager", "", p);
- }
- Object pds;
-
- try {
- pds = nameCtx.lookup(dataSourceName);
- if (pds instanceof HPT4ConnectionPoolDataSource) {
- poolManager = new HPT4PooledConnectionManager((HPT4ConnectionPoolDataSource) pds, getT4LogLevel());
- }
- } catch (javax.naming.NameNotFoundException nnfe) {
- }
- }
-
- // --------------------------------------------------------
- void setupLogFileHandler() {
- try {
- if (getT4LogFile() == null) {
- setT4LogFile(getT4GlobalLogFile());
- setT4LogFileHandler(getT4GlobalLogFileHandler());
- } else {
- if (getT4LogFileHandler() == null) {
- String temp = getT4LogFile();
- FileHandler fh1 = new FileHandler(temp);
-
- Formatter ff1 = new T4LogFormatter();
-
- fh1.setFormatter(ff1);
- setT4LogFileHandler(fh1);
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- } // end setupLogFileHandler
-
- // --------------------------------------------------------
-
- /**
- * Contructor for the <code>HPT4DataSource</code> object.
- *
- * @see #HPT4DataSource(java.util.Properties)
- */
- public HPT4DataSource() {
- super();
- if (getT4LogLevel() != Level.OFF) {
- setupLogFileHandler();
- }
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null);
- t4Logger_.logp(Level.FINE, "HPT4DataSource", "<init>",
- "Note, this constructor was called before the previous constructor", p);
- }
- try {
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4DataSource");
- lr.setSourceMethodName("<init>");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
-
- }
-
- /**
- * Contructor for the <code>HPT4DataSource</code> object.
- *
- * @param info
- * Contains all the Type 4 properties in a <code>name,
- * value</code>
- * pair.
- * @see #HPT4DataSource()
- * @see java.util.Properties
- */
- public HPT4DataSource(Properties info) {
- super(info);
- if (getT4LogLevel() != Level.OFF) {
- setupLogFileHandler();
- }
- if (t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null);
- t4Logger_.logp(Level.FINE, "HPT4DataSource", "<init>",
- "Note, this constructor was called before the previous constructor", p);
- }
- try {
- if (getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4DataSource");
- lr.setSourceMethodName("<init>");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- }
-
- /**
- * @deprecated
- */
- public void setNameType(String nameType) {
- }
-
- /**
- * @deprecated
- */
- public String getNameType() {
- return null;
- }
-
- // fields
- HPT4PooledConnectionManager poolManager;
-
- public Logger getParentLogger() throws SQLFeatureNotSupportedException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Object unwrap(Class iface) throws SQLException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isWrapperFor(Class iface) throws SQLException {
- // TODO Auto-generated method stub
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSourceFactory.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSourceFactory.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSourceFactory.java
deleted file mode 100644
index 1b7a8da..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4DataSourceFactory.java
+++ /dev/null
@@ -1,62 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-
-public class HPT4DataSourceFactory implements javax.naming.spi.ObjectFactory {
- public HPT4DataSourceFactory() {
- }
-
- public Object getObjectInstance(Object refobj, Name name, Context nameCtx, Hashtable env) throws Exception {
- Reference ref = (Reference) refobj;
- HPT4DataSource ds;
- String dataSourceName = null;
-
- if (ref.getClassName().equals("org.trafodion.jdbc.t4.HPT4DataSource")) {
- Properties props = new Properties();
- for (Enumeration enum2 = ref.getAll(); enum2.hasMoreElements();) {
- RefAddr tRefAddr = (RefAddr) enum2.nextElement();
- String type = tRefAddr.getType();
- String content = (String) tRefAddr.getContent();
- props.setProperty(type, content);
- }
-
- ds = new HPT4DataSource(props);
- dataSourceName = ds.getDataSourceName();
-
- if (dataSourceName != null) {
- ds.setPoolManager(nameCtx, dataSourceName);
- }
- return ds;
- } else {
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Desc.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Desc.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Desc.java
deleted file mode 100644
index 1eec5a3..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Desc.java
+++ /dev/null
@@ -1,542 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Types;
-import java.util.Locale;
-
-class HPT4Desc {
-
- String getColumnClassName() throws SQLException {
- switch (dataType_) {
- case Types.SMALLINT:
- return "java.lang.Integer";
- case Types.INTEGER:
- return "java.lang.Integer";
- case Types.BIGINT:
- return "java.lang.Long";
- case Types.REAL:
- return "java.lang.Float";
- case Types.FLOAT:
- case Types.DOUBLE:
- return "java.lang.Double";
- case Types.NUMERIC:
- case Types.DECIMAL:
- return "java.math.BigDecimal";
- case Types.CHAR:
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- return "java.lang.String";
- case Types.DATE:
- return "java.sql.Date";
- case Types.TIME:
- return "java.sql.Time";
- case Types.TIMESTAMP:
- return "java.sql.Timestamp";
- case Types.OTHER:
- return "java.sql.String";
- case Types.CLOB:
- return "java.sql.Clob";
- case Types.BLOB:
- return "java.sql.Blob";
- case Types.BIT:
- case Types.TINYINT:
- default:
- return null;
- }
- } // end getColumnClassName
-
- // ---------------------------------------------------------------
- String getColumnTypeName(Locale locale) throws SQLException {
- switch (dataType_) {
- case Types.SMALLINT:
- return "SMALLINT";
- case Types.INTEGER:
- return "INTEGER";
- case Types.BIGINT:
- return "BIGINT";
- case Types.REAL:
- return "REAL";
- case Types.FLOAT:
- return "FLOAT";
- case Types.DOUBLE:
- return "DOUBLE PRECISION";
- case Types.NUMERIC:
- return "NUMERIC";
- case Types.DECIMAL:
- return "DECIMAL";
- case Types.CHAR:
- return "CHAR";
- case Types.VARCHAR:
- return "VARCHAR";
- case Types.LONGVARCHAR:
- return "LONG VARCHAR";
- case Types.DATE:
- return "DATE";
- case Types.TIME:
- return "TIME";
- case Types.TIMESTAMP:
- return "TIMESTAMP";
- case Types.BLOB:
- return "BLOB";
- case Types.CLOB:
- return "CLOB";
- case Types.OTHER:
- if (sqlDataType_ == SQLTYPECODE_INTERVAL) {
- return "INTERVAL";
- } else {
- return "UNKNOWN";
- }
- case Types.BIT:
- case Types.TINYINT:
- default:
- return null;
- }
- } // end getColumnTypeName
-
- // ---------------------------------------------------------------
- void checkValidNumericConversion(Locale locale) throws SQLException {
- switch (dataType_) {
- case Types.TINYINT:
- case Types.SMALLINT:
- case Types.INTEGER:
- case Types.BIGINT:
- case Types.REAL:
- case Types.FLOAT:
- case Types.DOUBLE:
- case Types.NUMERIC:
- case Types.DECIMAL:
- case Types.BIT:
- case Types.CHAR:
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- case Types.CLOB:
- case Types.BLOB:
- break;
- default:
- System.out.println("Data type is " + dataType_);
- throw HPT4Messages.createSQLException(null, locale, "restricted_data_type", null);
- }
- return;
- } // end checkValidNumericConversion
-
- // ---------------------------------------------------------------
- // Constructors
- HPT4Desc(int dataType, short datetimeCode, int maxLen, short precision, short scale, boolean nullInfo,
- String colName, boolean signType, int odbcDataType, short odbcPrecision, int sqlCharset, int odbcCharset,
- String catalogName, String schemaName, String tableName, int fsDataType, int intLeadPrec, int paramMode) {
- catalogName_ = catalogName;
- schemaName_ = schemaName;
- tableName_ = tableName;
- name_ = colName;
- if (nullInfo) {
- isNullable_ = ResultSetMetaData.columnNullable;
- } else {
- isNullable_ = ResultSetMetaData.columnNoNulls;
-
- }
-
- sqlDataType_ = dataType;
- dataType_ = odbcDataType;
- sqlDatetimeCode_ = datetimeCode;
- sqlCharset_ = sqlCharset;
- odbcCharset_ = odbcCharset;
- isSigned_ = signType;
- sqlOctetLength_ = maxLen;
- scale_ = scale;
- sqlPrecision_ = precision;
-
- //
- // Convert ODBC type to equivalent JDBC type when necessary.
- //
- // From SqlUcode.h
- //
- // #define SQL_WCHAR (-8)
- // #define SQL_WVARCHAR (-9)
- // #define SQL_WLONGVARCHAR (-10)
- //
- if (odbcDataType == -8) {
-
- // ODBC's SQL_WCHAR becomes a Types.CHAR
- dataType_ = Types.CHAR;
- } else if (odbcDataType == -9) {
-
- // ODBC's SQL_WVARCHAR becomes a Types.VARCHAR
- dataType_ = Types.VARCHAR;
- } else if (odbcDataType == -10) {
-
- // ODBC's SQL_WLONGVARCHAR becomes a Types.LONGVARCHAR
- dataType_ = Types.LONGVARCHAR;
-
- }
- if (sqlDataType_ == InterfaceResultSet.SQLTYPECODE_DATETIME) // 9
- {
- switch (dataType_) { // ODBC conversion to ODBC2.0
- case 9: // ODBC2 Date
-
- // check the datetime code and set appropriately
- switch (sqlDatetimeCode_) {
- case SQLDTCODE_YEAR:
- case SQLDTCODE_YEAR_TO_MONTH:
- case SQLDTCODE_MONTH:
- case SQLDTCODE_MONTH_TO_DAY:
- case SQLDTCODE_DAY:
- dataType_ = Types.OTHER;
- precision_ = odbcPrecision;
- displaySize_ = maxLen;
- sqlOctetLength_ = maxLen;
- break;
- default:
- dataType_ = Types.DATE;
- break;
- }
- break;
- case 10: // ODBC2 TIME
- switch (sqlDatetimeCode_) {
- case SQLDTCODE_HOUR:
- case SQLDTCODE_HOUR_TO_MINUTE:
- case SQLDTCODE_MINUTE:
- case SQLDTCODE_MINUTE_TO_SECOND:
- case SQLDTCODE_SECOND:
- dataType_ = Types.OTHER;
- precision_ = odbcPrecision;
- displaySize_ = maxLen;
- sqlOctetLength_ = maxLen;
- break;
- default:
- dataType_ = Types.TIME;
- break;
- }
- break;
- case 11: // ODBC2 TIMESTAMP
- switch (sqlDatetimeCode_) {
- case SQLDTCODE_YEAR_TO_HOUR:
- case SQLDTCODE_YEAR_TO_MINUTE:
- case SQLDTCODE_MONTH_TO_HOUR:
- case SQLDTCODE_MONTH_TO_MINUTE:
- case SQLDTCODE_MONTH_TO_SECOND:
- // case SQLDTCODE_MONTH_TO_FRACTION:
- case SQLDTCODE_DAY_TO_HOUR:
- case SQLDTCODE_DAY_TO_MINUTE:
- case SQLDTCODE_DAY_TO_SECOND:
- // case SQLDTCODE_DAY_TO_FRACTION:
- case SQLDTCODE_HOUR_TO_FRACTION: // note: Database
- // maps to TIME(6)
- // NCS maps to TIMESTAMP
- case SQLDTCODE_MINUTE_TO_FRACTION:
- case SQLDTCODE_SECOND_TO_FRACTION:
- dataType_ = Types.OTHER;
- precision_ = odbcPrecision;
- displaySize_ = maxLen;
- sqlOctetLength_ = maxLen;
- break;
- default:
- dataType_ = Types.TIMESTAMP;
- break;
- }
- break;
- default:
- dataType_ = Types.TIMESTAMP;
- break;
- }
- }
-
- switch (dataType_) {
- case Types.NUMERIC:
- case Types.DECIMAL:
- precision_ = odbcPrecision;
- displaySize_ = precision_ + 2; // 1 for dot and 1 for sign
- // if (scale != 0) // ODBC2.0
- // isCurrency_ = true;
- break;
- case Types.SMALLINT:
- precision_ = odbcPrecision;
- if (isSigned_) {
- displaySize_ = 6;
- } else {
- dataType_ = Types.INTEGER;
- displaySize_ = 5;
- }
- break;
- case Types.INTEGER:
- precision_ = odbcPrecision;
- if (isSigned_) {
- displaySize_ = 11;
- } else {
- dataType_ = Types.BIGINT;
- displaySize_ = 10;
- }
- break;
- case Types.TINYINT:
- precision_ = odbcPrecision;
- if (isSigned_) {
- displaySize_ = 4;
- } else {
- displaySize_ = 3;
- }
- break;
- case Types.BIGINT:
- precision_ = odbcPrecision;
- if (isSigned_) {
- displaySize_ = 20;
- } else {
- displaySize_ = 19;
- }
- break;
- case Types.REAL:
- precision_ = odbcPrecision;
- displaySize_ = 15;
- break;
- case Types.DOUBLE:
- case Types.FLOAT:
- precision_ = odbcPrecision;
- displaySize_ = 24;
- break;
- case Types.DATE:
- sqlOctetLength_ = maxLen + 3;
- displaySize_ = 10;
- precision_ = 10; // ODBC2.0
- break;
- case Types.TIME:
- sqlOctetLength_ = maxLen + 3;
- displaySize_ = (precision == 0)?8: precision + 9;
- precision_ = 8; // ODBC2.0
- break;
- case Types.TIMESTAMP:
- sqlOctetLength_ = maxLen + 3;
- precision_ = odbcPrecision;
- displaySize_ = precision_;
- if (sqlDatetimeCode_ > 3) // if it is more than 3, it is one of
- // SQL/MP Datetime columns
- {
- // like YEAR, YEAR TO MONTH, YEAR TO DAY ...see dfs2rec.h
- dataType_ = Types.OTHER;
- }
- break;
- case Types.CHAR:
-
- // sqlOctetLength_ = maxLen+1;
- sqlOctetLength_ = maxLen;
- displaySize_ = maxLen;
- precision_ = maxLen; // ODBC2.0
- break;
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- case Types.BLOB:
- case Types.CLOB:
- boolean shortLength = maxLen < Math.pow(2, 15);
- int dataOffset = ((shortLength) ? 2 : 4);
- if (sqlDataType_ == SQLTYPECODE_VARCHAR) {
- sqlOctetLength_ = maxLen + 1;
- } else {
- sqlOctetLength_ = maxLen + dataOffset + 1;
- }
- displaySize_ = maxLen;
- precision_ = maxLen; // ODBC2.0
- break;
- default:
- if (sqlDataType_ == SQLTYPECODE_INTERVAL) {
- dataType_ = Types.OTHER;
- precision_ = odbcPrecision;
- displaySize_ = maxLen; // Make sure maxLen returns the right
- // display size for interval
- // sqlOctetLength_ = maxLen+3;
- // Swastik - commented above line 02/10/2005 for Interval Data
- // Type support
- // 3 was added earlier because interval datatype was handled in
- // the same
- // way as varchar and varchar-long were handled. Since we are
- // separating it
- // we don't need to add the additional 3
- sqlOctetLength_ = maxLen;
- }
- break;
- }
- if (sqlDataType_ == SQLTYPECODE_CHAR || sqlDataType_ == SQLTYPECODE_VARCHAR
- || sqlDataType_ == SQLTYPECODE_BLOB || sqlDataType_ == SQLTYPECODE_CLOB
- || sqlDataType_ == SQLTYPECODE_VARCHAR_LONG || sqlDataType_ == SQLTYPECODE_VARCHAR_WITH_LENGTH) {
- isCaseSensitive_ = true;
- }
- isSearchable_ = true;
- fsDataType_ = fsDataType;
- intLeadPrec_ = intLeadPrec;
- paramMode_ = paramMode;
- } // end HPT4Desc
-
- // ---------------------------------------------------------------
- // Constructors
-
- HPT4Desc(
- int noNullValue // Descriptor2 only
- ,
- int nullValue // Descriptor2 only
- ,
- int version // Descriptor2 only
- , int dataType, short datetimeCode, int maxLen, short precision, short scale, boolean nullInfo,
- boolean signType // same as signe
- , int odbcDataType, int odbcPrecision, int sqlCharset, int odbcCharset, String colName // same
- // as
- // colHeadingNm
- , String tableName, String catalogName, String schemaName, String headingName // Descriptor2
- // only
- , int intLeadPrec, int paramMode, int fsDataType // fsDataType
- // seems to be
- // the same as
- // dataType (see
- // old
- // descriptor)
- , int rowLength) {
-
- //
- // Call the old constructor to set the items that are
- // in both the old descriptor and the new descriptor.
- //
- this(dataType, datetimeCode, maxLen, precision, scale, nullInfo, colName, signType, odbcDataType,
- (short) odbcPrecision, sqlCharset, odbcCharset, catalogName, schemaName, tableName, fsDataType,
- intLeadPrec, paramMode);
- //
- // Set the items specific to the new descriptor.
- //
- noNullValue_ = noNullValue;
- nullValue_ = nullValue;
- version_ = version;
- headingName_ = headingName;
- rowLength_ = rowLength;
-
- maxLen_ = maxLen;
-
- } // end HPT4Desc
-
- // ---------------------------------------------------------------
- /***************************************************************************
- * Returns encoding type for character data types from Database
- * COLS table.
- */
- String getCharacterSetName() throws SQLException {
- switch (dataType_) {
- case Types.CHAR:
- case Types.VARCHAR:
- case Types.LONGVARCHAR:
- case Types.BLOB:
- case Types.CLOB:
- return (String) InterfaceUtilities.getCharsetName(sqlCharset_);
- default:
- return null;
- }
- }
-
- // ---------------------------------------------------------------
- // Constants
- public static final int SQLTYPECODE_CHAR = 1;
- public static final int SQLTYPECODE_VARCHAR = 12;
- public static final int SQLTYPECODE_VARCHAR_LONG = -1;
- public static final int SQLTYPECODE_INTERVAL = 10;
- public static final int SQLTYPECODE_VARCHAR_WITH_LENGTH = -601;
- public static final int SQLTYPECODE_BLOB = -602;
- public static final int SQLTYPECODE_CLOB = -603;
- public static final int SQLTYPECODE_SMALLINT = 5;
- public static final int SQLTYPECODE_INTEGER = 4;
-
- // datetime codes taken from NCS - File ....\....\...\Common\DrvrSrvr.h
- public static final int SQLDTCODE_YEAR = 4;
- public static final int SQLDTCODE_YEAR_TO_MONTH = 5;
- // public static final int SQLDTCODE_YEAR_TO_DAY 1 //Database
- // DATE
- public static final int SQLDTCODE_YEAR_TO_HOUR = 7; // ODBC TIMESTAMP(0)
- public static final int SQLDTCODE_YEAR_TO_MINUTE = 8;
- // public static final int SQLDTCODE_YEAR_TO_SECOND 3 //
- // DatabaseTIMESTAMP(0)
- // public static final int SQLDTCODE_YEAR_TO_FRACTION 3 //
- // Database TIMESTAMP(1 - 5)
- public static final int SQLDTCODE_MONTH = 10;
- public static final int SQLDTCODE_MONTH_TO_DAY = 11;
- public static final int SQLDTCODE_MONTH_TO_HOUR = 12;
- public static final int SQLDTCODE_MONTH_TO_MINUTE = 13;
- public static final int SQLDTCODE_MONTH_TO_SECOND = 14;
- public static final int SQLDTCODE_MONTH_TO_FRACTION = 14;
- public static final int SQLDTCODE_DAY = 15;
- public static final int SQLDTCODE_DAY_TO_HOUR = 16;
- public static final int SQLDTCODE_DAY_TO_MINUTE = 17;
- public static final int SQLDTCODE_DAY_TO_SECOND = 18;
- public static final int SQLDTCODE_DAY_TO_FRACTION = 18;
- public static final int SQLDTCODE_HOUR = 19;
- public static final int SQLDTCODE_HOUR_TO_MINUTE = 20;
- // define SQLDTCODE_HOUR_TO_SECOND 2 //Database TIME(0) --> NCS
- // Maps this to TIME
- public static final int SQLDTCODE_HOUR_TO_FRACTION = 2; // Database TIME(1 -
- // 6) // MXCI Maps
- // this to TIMESTAMP
- public static final int SQLDTCODE_MINUTE = 22;
- public static final int SQLDTCODE_MINUTE_TO_SECOND = 23;
- public static final int SQLDTCODE_MINUTE_TO_FRACTION = 23;
- public static final int SQLDTCODE_SECOND = 24;
- public static final int SQLDTCODE_SECOND_TO_FRACTION = 24;
- public static final int SQLDTCODE_FRACTION_TO_FRACTION = 29;
-
- // fields
- int sqlCharset_;
- int odbcCharset_;
- int sqlDataType_;
- int dataType_;
- short sqlPrecision_;
- short sqlDatetimeCode_;
- int sqlOctetLength_;
- int isNullable_;
- String name_;
- short scale_;
- int precision_;
- boolean isSigned_;
- boolean isCurrency_;
- boolean isCaseSensitive_;
- String catalogName_;
- String schemaName_;
- String tableName_;
- int fsDataType_;
- int intLeadPrec_;
- int paramMode_;
- int paramIndex_;
- int paramPos_;
-
- String columnClassName_;
- int displaySize_;
- // fields which are not pouplated now
- String columnLabel_;
- boolean isAutoIncrement_;
- boolean isSearchable_;
-
- boolean isValueSet_; // To denote if setXXX method is called for this
- // parameter
- // String paramValue_; // Contains the value of output parameter value
- Object paramValue_; // Contains the value of output parameter value
-
- int noNullValue_; // Descriptor2 only
- int nullValue_; // Descriptor2 only
- int version_; // Descriptor2 only
-
- String headingName_; // Descriptor2 only
-
- int rowLength_;
- int maxLen_;
-
-} // end class HPT4Desc
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Exception.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Exception.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Exception.java
deleted file mode 100644
index 10c8d18..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Exception.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.SQLException;
-
-class HPT4Exception extends SQLException {
- protected String messageId;
-
- public HPT4Exception(String reason, String SQLState, int vendorCode, String msgId) {
- super(reason, SQLState, vendorCode);
- if (msgId == null) {
- messageId = "";
- } else {
- messageId = msgId;
- }
- }
-
-} // end class HPT4Exception
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Handle.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Handle.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Handle.java
deleted file mode 100644
index 10a62b9..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Handle.java
+++ /dev/null
@@ -1,84 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-
-public abstract class HPT4Handle {
- SQLWarning sqlWarning_;
-
- public void clearWarnings() throws SQLException {
- sqlWarning_ = null;
- }
-
- public SQLWarning getWarnings() throws SQLException {
- return sqlWarning_;
- }
-
- void setSQLWarning(T4Properties t4props, String messageId, Object[] messageArguments) {
- SQLWarning sqlWarningLeaf = HPT4Messages.createSQLWarning(t4props, messageId, messageArguments);
- if (sqlWarning_ == null) {
- sqlWarning_ = sqlWarningLeaf;
- } else {
- sqlWarning_.setNextWarning(sqlWarningLeaf);
- }
- }
-
- // Method used by JNI layer to set the warning
- void setSqlWarning(SQLWarning sqlWarning) {
- if (sqlWarning_ == null) {
- sqlWarning_ = sqlWarning;
- } else {
- sqlWarning_.setNextWarning(sqlWarning);
- }
- }
-
- // Method added to check if the connection had any errors
- // This calls the abstract method closeErroredConnection()
- //returns true if a connection error occured
- boolean performConnectionErrorChecks(SQLException se) {
- if (se instanceof HPT4Exception) {
- HPT4Exception sqlmx_e = (HPT4Exception) se;
- if (sqlmx_e.messageId.equals(ERROR_SOCKET_WRITE_ERROR) || sqlmx_e.messageId.equals(ERROR_SOCKET_READ_ERROR)
- || sqlmx_e.messageId.equals(ERROR_SOCKET_IS_CLOSED_ERROR)
- || sqlmx_e.messageId.equals(ERROR_INVALID_CONNECTION) || sqlmx_e.messageId.equals(ERROR_IDS_08_S01)
- || sqlmx_e.messageId.equals(IDS_S1_T00)
- || sqlmx_e.messageId.equals(ERROR_SOCKET_OPEN)) {
- closeErroredConnection(sqlmx_e);
- return true;
- }
- }
-
- return false;
- }
-
- abstract void closeErroredConnection(HPT4Exception se);
-
- static final String ERROR_IDS_08_S01 = new String("ids_08_s01");
- static final String ERROR_INVALID_CONNECTION = new String("invalid_connection");
- static final String ERROR_SOCKET_WRITE_ERROR = new String("socket_write_error");
- static final String ERROR_SOCKET_READ_ERROR = new String("socket_read_error");
- static final String ERROR_SOCKET_IS_CLOSED_ERROR = new String("socket_is_closed_error");
- static final String IDS_S1_T00 = new String("ids_s1_t00");
- static final String ERROR_SOCKET_OPEN = new String("socket_open_error");
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Messages.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Messages.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Messages.java
deleted file mode 100644
index cf58470..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4Messages.java
+++ /dev/null
@@ -1,324 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.SQLWarning;
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-class HPT4Messages {
- static Logger getMessageLogger(T4Properties t4props) {
- return (t4props != null) ? t4props.t4Logger_ : T4Properties.t4GlobalLogger;
- }
-
- static SQLWarning createSQLWarning(T4Properties t4props, String messageId, Object[] messageArguments) {
- Logger log = getMessageLogger(t4props);
-
- if (log != null && log.isLoggable(Level.WARNING)) {
- Object p[] = T4LoggingUtilities.makeParams(t4props, messageId, messageArguments);
- log.logp(Level.WARNING, "HPT4Messages", "createSQLWarning", "", p);
- }
-
- Locale currentLocale = t4props == null ? null : t4props.getLocale();
- currentLocale = currentLocale == null ? Locale.getDefault() : currentLocale;
-
- int sqlcode = 1;
- SQLWarning ret = null;
-
- try {
- PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("T4Messages",
- currentLocale);
-
- MessageFormat formatter = new MessageFormat("");
- formatter.setLocale(currentLocale);
- formatter.applyPattern(messageBundle.getString(messageId + "_msg"));
-
- String message = formatter.format(messageArguments);
- String sqlState = messageBundle.getString(messageId + "_sqlstate");
- String sqlcodeStr = messageBundle.getString(messageId + "_sqlcode");
-
- if (sqlcodeStr != null) {
- try {
- sqlcode = Integer.parseInt(sqlcodeStr);
- } catch (NumberFormatException e1) {
- // use 1 as default
- }
- }
-
- ret = new SQLWarning(message, sqlState, sqlcode);
- } catch (MissingResourceException e) {
- // If the resource bundle is not found, concatenate the messageId
- // and the parameters
- String message;
- int i = 0;
-
- message = "The message id: " + messageId;
- if (messageArguments != null) {
- message = message.concat(" With parameters: ");
- while (true) {
- message = message.concat(messageArguments[i++].toString());
- if (i >= messageArguments.length) {
- break;
- } else {
- message = message.concat(",");
- }
- }
- } // end if
-
- ret = new SQLWarning(message, "01000", 1);
- }
-
- return ret;
- }
-
- static void setSQLWarning(T4Properties t4props, HPT4Handle handle, SQLWarningOrError[] we1) {
- Logger log = getMessageLogger(t4props);
-
- int curErrorNo;
- SQLWarning sqlWarningLeaf;
-
- if (we1.length == 0) {
- handle.setSqlWarning(null);
- return;
- }
-
- for (curErrorNo = 0; curErrorNo < we1.length; curErrorNo++) {
- if (log != null && log.isLoggable(Level.WARNING)) {
- Object p[] = new Object[] { t4props, "Text: " + we1[curErrorNo].text,
- "SQLState: " + we1[curErrorNo].sqlState, "SQLCode: " + we1[curErrorNo].sqlCode };
- log.logp(Level.WARNING, "HPT4Messages", "setSQLWarning", "", p);
- }
-
- sqlWarningLeaf = new SQLWarning(we1[curErrorNo].text, we1[curErrorNo].sqlState, we1[curErrorNo].sqlCode);
- handle.setSqlWarning(sqlWarningLeaf);
- } // end for
- return;
- }
-
- static void setSQLWarning(T4Properties t4props, HPT4Handle handle, ERROR_DESC_LIST_def sqlWarning) {
- Logger log = getMessageLogger(t4props);
-
- int curErrorNo;
- ERROR_DESC_def error_desc_def[];
- SQLWarning sqlWarningLeaf;
-
- if (sqlWarning.length == 0) {
- handle.setSqlWarning(null);
- return;
- }
-
- error_desc_def = sqlWarning.buffer;
- for (curErrorNo = 0; curErrorNo < sqlWarning.length; curErrorNo++) {
- if (log != null && log.isLoggable(Level.WARNING)) {
- Object p[] = new Object[] { t4props, "Text: " + error_desc_def[curErrorNo].errorText,
- "SQLState: " + error_desc_def[curErrorNo].sqlstate,
- "SQLCode: " + error_desc_def[curErrorNo].sqlcode };
- log.logp(Level.WARNING, "HPT4Messages", "setSQLWarning", "", p);
- }
-
- sqlWarningLeaf = new SQLWarning(error_desc_def[curErrorNo].errorText, error_desc_def[curErrorNo].sqlstate,
- error_desc_def[curErrorNo].sqlcode);
- handle.setSqlWarning(sqlWarningLeaf);
- }
- return;
- } // end setSQLWarning
-
- // ------------------------------------------------------------------------------------------------
- static void throwSQLException(T4Properties t4props, ERROR_DESC_LIST_def SQLError) throws HPT4Exception {
- Logger log = getMessageLogger(t4props);
- Locale locale = (t4props != null) ? t4props.getLocale() : Locale.getDefault();
-
- HPT4Exception sqlException = null;
- HPT4Exception sqlExceptionHead = null;
- int curErrorNo;
-
- if (SQLError.length == 0) {
- throw createSQLException(t4props, locale, "No messages in the Error description", null);
- }
-
- for (curErrorNo = 0; curErrorNo < SQLError.length; curErrorNo++) {
- if (log != null && log.isLoggable(Level.SEVERE)) {
- Object p[] = new Object[] { t4props, "Text: " + SQLError.buffer[curErrorNo].errorText,
- "SQLState: " + SQLError.buffer[curErrorNo].sqlstate,
- "SQLCode: " + SQLError.buffer[curErrorNo].sqlcode };
- log.logp(Level.SEVERE, "HPT4Messages", "throwSQLException", "", p);
- }
-
- if (SQLError.buffer[curErrorNo].errorCodeType == TRANSPORT.ESTIMATEDCOSTRGERRWARN) {
- //
- // NCS said it was an SQL error, but it really wasn't it was a
- // NCS resource governing error
- //
- sqlException = HPT4Messages.createSQLException(t4props, locale, "resource_governing", null);
- } else {
- sqlException = new HPT4Exception(SQLError.buffer[curErrorNo].errorText,
- SQLError.buffer[curErrorNo].sqlstate, SQLError.buffer[curErrorNo].sqlcode, null);
- }
- if (curErrorNo == 0) {
- sqlExceptionHead = sqlException;
- } else {
- sqlExceptionHead.setNextException(sqlException);
- }
- }
-
- throw sqlExceptionHead;
- }
-
- // ------------------------------------------------------------------------------------------------
- static void throwSQLException(T4Properties t4props, SQLWarningOrError[] we1) throws HPT4Exception {
- Logger log = getMessageLogger(t4props);
- Locale locale = (t4props != null) ? t4props.getLocale() : Locale.getDefault();
-
- HPT4Exception sqlException = null;
- HPT4Exception sqlExceptionHead = null;
- int curErrorNo;
-
- if (we1.length == 0) {
- throw createSQLException(t4props, locale, "No messages in the Error description", null);
- }
-
- for (curErrorNo = 0; curErrorNo < we1.length; curErrorNo++) {
- if (log != null && log.isLoggable(Level.SEVERE)) {
- Object p[] = new Object[] { t4props, "Text: " + we1[curErrorNo].text,
- "SQLState: " + we1[curErrorNo].sqlState, "SQLCode: " + we1[curErrorNo].sqlCode };
- log.logp(Level.SEVERE, "HPT4Messages", "throwSQLException", "", p);
- }
-
- sqlException = new HPT4Exception(we1[curErrorNo].text, we1[curErrorNo].sqlState, we1[curErrorNo].sqlCode,
- null);
- if (curErrorNo == 0) {
- sqlExceptionHead = sqlException;
- } else {
- sqlExceptionHead.setNextException(sqlException);
- }
- } // end for
-
- throw sqlExceptionHead;
- } // end throwSQLException
-
- // ------------------------------------------------------------------------------------------------
- static HPT4Exception createSQLException(T4Properties t4props, Locale msgLocale, String messageId, Object mA1,
- Object mA2) {
-
- Object[] mAs = new Object[2];
-
- mAs[0] = mA1;
- mAs[1] = mA2;
-
- return createSQLException(t4props, msgLocale, messageId, mAs);
-
- } // end createSQLException
-
- // ------------------------------------------------------------------------------------------------
- static HPT4Exception createSQLException(T4Properties t4props, Locale msgLocale, String messageId,
- Object messageArgument) {
- Object[] mAs = new Object[1];
-
- mAs[0] = messageArgument;
-
- return createSQLException(t4props, msgLocale, messageId, mAs);
-
- } // end createSQLException
-
- // ------------------------------------------------------------------------------------------------
- static HPT4Exception createSQLException(T4Properties t4props, Locale msgLocale, String messageId,
- Object[] messageArguments) {
- Logger log = getMessageLogger(t4props);
-
- if (log != null && log.isLoggable(Level.SEVERE)) {
- Object p[] = T4LoggingUtilities.makeParams(t4props, messageId, messageArguments);
- log.logp(Level.SEVERE, "HPT4Messages", "createSQLException", "", p);
- }
-
- Locale currentLocale = t4props == null ? null : t4props.getLocale();
- currentLocale = currentLocale == null ? Locale.getDefault(): currentLocale;
-
- int sqlcode;
- try {
- PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("T4Messages",
- currentLocale);
-
- MessageFormat formatter = new MessageFormat("");
- formatter.setLocale(currentLocale);
- formatter.applyPattern(messageBundle.getString(messageId + "_msg"));
-
- String message = formatter.format(messageArguments);
- String sqlState = messageBundle.getString(messageId + "_sqlstate");
- String sqlcodeStr = messageBundle.getString(messageId + "_sqlcode");
-
- if (sqlcodeStr != null) {
- try {
- sqlcode = Integer.parseInt(sqlcodeStr);
- sqlcode = -sqlcode;
- } catch (NumberFormatException e1) {
- sqlcode = -1;
- }
- } else {
- sqlcode = -1;
-
- }
- return new HPT4Exception(message, sqlState, sqlcode, messageId);
- } catch (MissingResourceException e) {
- // If the resource bundle is not found, concatenate the messageId
- // and the parameters
- String message;
- int i = 0;
-
- message = "The message id: " + messageId;
- if (messageArguments != null) {
- message = message.concat(" With parameters: ");
- while (true) {
- message = message.concat(messageArguments[i++] + "");
- if (i >= messageArguments.length) {
- break;
- } else {
- message = message.concat(",");
- }
- }
- } // end if
-
- return new HPT4Exception(message, "HY000", -1, messageId);
- } // end catch
- } // end createSQLException
-
- // ------------------------------------------------------------------------------------------------
- static void throwUnsupportedFeatureException(T4Properties t4props, Locale locale, String s) throws HPT4Exception {
- Object[] messageArguments = new Object[1];
-
- messageArguments[0] = s;
- throw HPT4Messages.createSQLException(t4props, locale, "unsupported_feature", messageArguments);
- } // end throwUnsupportedFeatureException
-
- // ------------------------------------------------------------------------------------------------
- static void throwDeprecatedMethodException(T4Properties t4props, Locale locale, String s) throws HPT4Exception {
- Object[] messageArguments = new Object[1];
-
- messageArguments[0] = s;
- throw HPT4Messages.createSQLException(t4props, locale, "deprecated_method", messageArguments);
- } // end throwDeprecatedMethodException
-
-} // end class HPT4Messages
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ParameterMetaData.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ParameterMetaData.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ParameterMetaData.java
deleted file mode 100644
index b8b3422..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ParameterMetaData.java
+++ /dev/null
@@ -1,243 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.SQLException;
-import java.util.logging.Level;
-
-public class HPT4ParameterMetaData implements java.sql.ParameterMetaData {
-
- public String getParameterClassName(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
- return inputDesc[param - 1].getColumnClassName();
- }
-
- public int getParameterCount() throws SQLException {
- return inputDesc.length;
- }
-
- public int getParameterMode(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
- return inputDesc[param - 1].paramMode_;
- }
-
- public int getParameterType(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
- return inputDesc[param - 1].dataType_;
- }
-
- public String getParameterTypeName(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].getColumnTypeName(props.getLocale());
- }
-
- public int getPrecision(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].precision_;
- }
-
- public int getScale(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].scale_;
- }
-
- public int isNullable(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].isNullable_;
- }
-
- public boolean isSigned(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
- return inputDesc[param - 1].isSigned_;
- }
-
- // ////////////////////////
- // begin custom accessors//
- // ////////////////////////
- public int getRowLength() throws SQLException {
- // this is the same for all params
- // only if we have no input params will we throw an error
- if (inputDesc.length == 0) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[0].rowLength_;
- }
-
- public int getDisplaySize(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].displaySize_;
- }
-
- public int getFSDataType(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].fsDataType_;
- }
-
- public int getMaxLength(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].maxLen_;
- }
-
- public int getNoNullOffset(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].noNullValue_;
- }
-
- public int getNullOffset(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].nullValue_;
- }
-
- public int getOdbcCharset(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].odbcCharset_;
- }
-
- public int getSqlCharset(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].sqlCharset_;
- }
-
- public int getSqlDataType(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].sqlDataType_;
- }
-
- public int getSqlDatetimeCode(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].sqlDatetimeCode_;
- }
-
- public int getSqlOctetLength(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].sqlOctetLength_;
- }
-
- public int getSqlPrecision(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].sqlPrecision_;
- }
-
- // /////////////////////////////////
- // these are legacy names...do not remove these yet even though they are
- // duplicate
- // i will depricate these before 2.3 release
- // ///////////////////////////////
-
- /**
- * @deprecated
- */
- public int getSqlTypeCode(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].dataType_;
- }
-
- /**
- * @deprecated
- */
- public int getSqlLength(int param) throws SQLException {
- if (param > inputDesc.length) {
- throw HPT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
- }
-
- return inputDesc[param - 1].maxLen_;
- }
-
- HPT4ParameterMetaData(TrafT4PreparedStatement stmt, HPT4Desc[] inputDesc) {
- this.props = stmt.connection_.props_;
- this.inputDesc = inputDesc;
-
- if (props.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(stmt.connection_.props_, stmt, inputDesc);
- stmt.connection_.props_.t4Logger_.logp(Level.FINE, "HPT4ParameterMetaData", "", "", p);
- }
- }
-
- T4Properties props;
- HPT4Desc[] inputDesc;
- public Object unwrap(Class iface) throws SQLException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isWrapperFor(Class iface) throws SQLException {
- // TODO Auto-generated method stub
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnection.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnection.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnection.java
deleted file mode 100644
index 719d59a..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnection.java
+++ /dev/null
@@ -1,238 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.LinkedList;
-import java.util.Locale;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
-import javax.sql.ConnectionEvent;
-import javax.sql.ConnectionEventListener;
-import javax.sql.StatementEventListener;
-
-public class HPT4PooledConnection implements javax.sql.PooledConnection {
-
- public void addConnectionEventListener(ConnectionEventListener listener) {
- try {
- if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
- connection_.props_.t4Logger_.logp(Level.FINE, "HPT4PooledConnecton", "addConnectionEventListener", "",
- p);
- }
- if (connection_ != null && connection_.props_.getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4PooledConnection");
- lr.setSourceMethodName("addConnectionEventListener");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- connection_.props_.getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- if (isClosed_ || connection_ == null) {
- return;
- }
- listenerList_.add(listener);
- }
-
- public void close() throws SQLException {
- if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
- connection_.props_.t4Logger_.logp(Level.FINE, "HPT4PooledConnecton", "close", "", p);
- }
- if (connection_ != null && connection_.props_.getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4PooledConnection");
- lr.setSourceMethodName("close");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- connection_.props_.getLogWriter().println(temp);
- }
-
- //3196 - NDCS transaction for SPJ
- if (connection_.ic_.suspendRequest_) {
- connection_.suspendUDRTransaction();
- }
-
- if (isClosed_) {
- return;
- }
- connection_.close(true, true);
- }
-
- public Connection getConnection() throws SQLException {
- if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
- connection_.props_.t4Logger_.logp(Level.FINE, "HPT4PooledConnecton", "getConnection", "", p);
- }
- if (connection_ != null && connection_.props_.getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4PooledConnection");
- lr.setSourceMethodName("getConnection");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- connection_.props_.getLogWriter().println(temp);
- }
- if (isClosed_ || connection_ == null) {
- throw HPT4Messages.createSQLException(connection_.props_, locale_, "invalid_connection", null);
- }
- if (LogicalConnectionInUse_) {
- connection_.close(false, false);
- }
- LogicalConnectionInUse_ = true;
- connection_.reuse();
- return connection_;
- }
-
- public void removeConnectionEventListener(ConnectionEventListener listener) {
- try {
- if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
- connection_.props_.t4Logger_.logp(Level.FINE, "HPT4PooledConnecton", "removeConnectionEventListener",
- "", p);
- }
- if (connection_ != null && connection_.props_.getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4PooledConnection");
- lr.setSourceMethodName("removeConnectionEventListener");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- connection_.props_.getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- if (isClosed_ || connection_ == null) {
- return;
- }
- listenerList_.remove(listener);
- }
-
- // Called by TrafT4Connection when the connection is closed by the application
- void logicalClose(boolean sendEvents) {
- int i;
- int totalListener;
- ConnectionEventListener listener;
-
- LogicalConnectionInUse_ = false;
-
- try {
- //3196 - NDCS transaction for SPJ
- if (connection_.ic_.suspendRequest_) {
- connection_.suspendUDRTransaction();
- }
- }
- catch (SQLException ex) {}
-
- if (sendEvents) {
- totalListener = listenerList_.size();
- ConnectionEvent event = new ConnectionEvent(this);
- for (i = 0; i < totalListener; i++) {
- listener = (ConnectionEventListener) listenerList_.get(i);
- listener.connectionClosed(event);
- }
- }
- }
-
- void sendConnectionErrorEvent(SQLException ex) throws SQLException {
- int i;
- int totalListener;
- ConnectionEventListener listener;
-
- LogicalConnectionInUse_ = false;
- totalListener = listenerList_.size();
- ConnectionEvent event = new ConnectionEvent(this, ex);
- for (i = 0; i < totalListener; i++) {
- listener = (ConnectionEventListener) listenerList_.get(i);
- listener.connectionErrorOccurred(event);
- }
- close();
- }
-
- // Constructor
- HPT4PooledConnection(HPT4ConnectionPoolDataSource pds, T4Properties t4props) throws SQLException {
- super();
-
- T4Properties t4LocalProps;
-
- pds_ = pds;
- if (t4props != null) {
- t4LocalProps = t4props;
- locale_ = t4props.getLocale();
- } else {
- t4LocalProps = new T4Properties();
- locale_ = Locale.getDefault();
- }
- listenerList_ = new LinkedList();
- connection_ = new TrafT4Connection(this, t4LocalProps);
- try {
- if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_, pds, t4props);
- connection_.props_.t4Logger_.logp(Level.FINE, "HPT4PooledConnecton", "", "", p);
- }
- if (connection_ != null && connection_.props_.getLogWriter() != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(connection_.props_, pds, t4props);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4PooledConnection");
- lr.setSourceMethodName("");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- connection_.props_.getLogWriter().println(temp);
- }
- } catch (SQLException se) {
- // ignore
- }
- }
-
- TrafT4Connection getTrafT4ConnectionReference() {
- return connection_;
- }
-
- private LinkedList listenerList_;
- private boolean isClosed_ = false;
- private HPT4ConnectionPoolDataSource pds_;
- private TrafT4Connection connection_;
- private Locale locale_;
- private boolean LogicalConnectionInUse_ = false;
- public void addStatementEventListener(StatementEventListener listener) {
- // TODO Auto-generated method stub
-
- }
-
- public void removeStatementEventListener(StatementEventListener listener) {
- // TODO Auto-generated method stub
-
- }
-}
[5/9] incubator-trafodion git commit: Rename required prefix with Traf
Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnectionManager.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnectionManager.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnectionManager.java
deleted file mode 100644
index 0657b92..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4PooledConnectionManager.java
+++ /dev/null
@@ -1,385 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.Vector;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
-import javax.sql.ConnectionEvent;
-import javax.sql.ConnectionPoolDataSource;
-import javax.sql.PooledConnection;
-
-public class HPT4PooledConnectionManager implements javax.sql.ConnectionEventListener {
-
- public void connectionClosed(ConnectionEvent event) {
- if (T4Properties.t4GlobalLogger.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(null, event);
- T4Properties.t4GlobalLogger.logp(Level.FINE, "HPT4PooledConnectionManager", "connectionClosed", "", p);
- }
- if (out_ != null) {
- LogRecord lr = new LogRecord(Level.FINE, "");
- Object p[] = T4LoggingUtilities.makeParams(null, event);
- lr.setParameters(p);
- lr.setSourceClassName("HPT4PooledConnectionManager");
- lr.setSourceMethodName("connectionClosed");
- T4LogFormatter lf = new T4LogFormatter();
- String temp = lf.format(lr);
- out_.println(temp);
- }
- if (out_ != null) {
- if (traceLevel_ != Level.OFF) {
- out_.println(traceId_ + "connectionClosed(" + event + ")");
- }
- }
- PooledConnection pc;
-
- pc = (PooledConnection) event.getSource();
-
- boolean addToFreePool = true;
- if (minPoolSize_ > 0 && free_.size() >= minPoolSize_) {
- addToFreePool = false;
- }
- // If an initial pool is being created, then ensure that the connection
- // is
- // added to the free pool irrespective of minPoolSize being reached
- if (initialPoolCreationFlag_) {
- addToFreePool = true;
- }
- boolean wasPresent = removeInUseConnection(pc, addToFreePool);
-
- if (wasPresent && (!addToFreePool)) {
- try {
- pc.close();
- } catch (SQLException e) {
- // ignore any close error
- }
- }
- }
-
- public void connectionErrorOccurred(ConnectionEvent event) {
- if (out_ != null) {
- if (traceLevel_ != Level.OFF) {
- out_.println(traceId_ + "connectionErrorOccurred(" + event + ")");
- }
- }
-
- PooledConnection pc;
-
- pc = (PooledConnection) event.getSource();
- try {
- pc.close();
- } catch (SQLException e) {
- // ignore any close error
- }
- removeInUseConnection(pc, false);
- }
-
- public Connection getConnection() throws SQLException {
- if (out_ != null) {
- if (traceLevel_ != Level.OFF) {
- out_.println(traceId_ + "getConnection()");
- }
- }
-
- PooledConnection pc;
- boolean validConnection = false;
-
- do {
- if (free_.size() == 0) {
- if (maxPoolSize_ == 0 || count_ < maxPoolSize_) {
- pc = pds_.getPooledConnection();
- count_++;
- pc.addConnectionEventListener(this);
- inUse_.add(pc);
-
- TrafT4Connection c = (TrafT4Connection) pc.getConnection();
- try {
- c.ic_.enforceT4ConnectionTimeout(c);
- validConnection = true;
- } catch (SQLException sqlEx) {
- try {
- pc.close();
- } catch (Exception e) {
- } // cleanup, ignore any errors
- }
- } else {
- throw HPT4Messages.createSQLException(null, null, "max_pool_size_reached", null);
- }
- } else {
- pc = (PooledConnection) free_.get(0);
- if (removeFreeConnection(pc, true)) {
- TrafT4Connection c = (TrafT4Connection) pc.getConnection();
- try {
- c.ic_.enforceT4ConnectionTimeout(c);
- validConnection = true;
- } catch (SQLException sqlEx) {
- try {
- pc.close();
- } catch (Exception e) {
- } // cleanup, ignore any errors
- }
- }
- }
- } while (!validConnection);
-
- return pc.getConnection();
- }
-
- private synchronized boolean removeFreeConnection(PooledConnection pc, boolean addToUsePool) {
- boolean wasPresent = free_.remove(pc);
- hashTab_.remove(pc);
- if (wasPresent) {
- if (addToUsePool) {
- inUse_.add(pc);
- } else {
- count_--;
- }
- }
- return wasPresent;
- }
-
- private synchronized boolean removeInUseConnection(PooledConnection pc, boolean addToFreePool) {
- boolean wasPresent = inUse_.remove(pc);
- hashTab_.remove(pc);
- if (wasPresent) {
- if (addToFreePool) {
- hashTab_.put(pc, new Long(System.currentTimeMillis() + (1000 * maxIdleTime_)));
- free_.add(pc);
- } else {
- count_--;
- }
- }
- return wasPresent;
- }
-
- private void createInitialPool(int initialPoolSize) throws SQLException {
- if (initialPoolSize <= 0) {
- return;
- }
-
- int limit = initialPoolSize > maxPoolSize_ ? maxPoolSize_ : initialPoolSize;
- Connection initPool_[] = new Connection[limit];
- int created = 0;
- try {
- // Set initialPoolInCreation to indicate that an initial pool is in
- // the
- // process of being created.
- initialPoolCreationFlag_ = true;
-
- for (int i = 0; i < limit; i++) {
- initPool_[i] = getConnection();
- created++;
- }
- } catch (SQLException se) {
- SQLException head = HPT4Messages.createSQLException(null, null, "initial_pool_creation_error", "" + limit);
- head.setNextException(se);
- throw head;
- } finally {
- for (int i = 0; i < created; i++) {
- try {
- if (initPool_[i] != null)
- initPool_[i].close();
- } catch (SQLException se) {
- // ignore
- }
- }
- // Ensuring that the initialPoolInCreation has been set to false to
- // indicate
- // that the initial pool creation process has occured.
- initialPoolCreationFlag_ = false;
- }
- }
-
- void setLogWriter(PrintWriter out) {
- out_ = out;
- }
-
- HPT4PooledConnectionManager(HPT4ConnectionPoolDataSource pds, Level traceLevel) throws SQLException {
- String className = getClass().getName();
- pds_ = pds;
- inUse_ = Collections.synchronizedList(new LinkedList());
- free_ = Collections.synchronizedList(new LinkedList());
- maxPoolSize_ = pds.getMaxPoolSize();
- minPoolSize_ = pds.getMinPoolSize();
- maxIdleTime_ = pds.getMaxIdleTime();
- connectionTimeout_ = pds.getConnectionTimeout();
- traceLevel_ = traceLevel;
- timer_ = null;
- if (maxIdleTime_ > 0 && maxPoolSize_ > 0) {
- IdleConnectionCleanupTask timerTask_ = new IdleConnectionCleanupTask();
- timer_ = new Timer(true);
- timer_.schedule(timerTask_, (maxIdleTime_ * 1000), (maxIdleTime_ * 500));
- }
- if (connectionTimeout_ > 0 && maxPoolSize_ > 0) {
- ConnectionTimeoutCleanupTask timerTask_ = new ConnectionTimeoutCleanupTask();
- if (timer_ == null) {
- timer_ = new Timer(true);
- }
- timer_.schedule(timerTask_, (connectionTimeout_ * 1000), (connectionTimeout_ * 500));
- }
- createInitialPool(pds.getInitialPoolSize());
- traceId_ = "jdbcTrace:[" + Thread.currentThread() + "]:[" + hashCode() + "]:" + className + ".";
- }
-
- ConnectionPoolDataSource pds_;
- // LinkedList inUse_;
- // LinkedList free_;
- List inUse_;
- List free_;
- int count_;
-
- int maxPoolSize_;
- int minPoolSize_;
- long maxIdleTime_;
- int connectionTimeout_;
- Level traceLevel_;
- PrintWriter out_;
- String traceId_;
- Timer timer_;
- Hashtable hashTab_ = new java.util.Hashtable(); // synchronized
- // We keep a flag to indicate to this class that an initial pool is in the
- // process
- // of being created
- boolean initialPoolCreationFlag_ = false;
-
- /*
- * Private class used to clean up the connections that have surpassed
- * maxIdleTime
- */
- /* Start TimerTask definition */
- private class IdleConnectionCleanupTask extends TimerTask {
- Vector toRemove = null;
-
- IdleConnectionCleanupTask() {
- toRemove = new Vector();
- }
-
- public void run() {
- cleanUp();
- }
-
- private void cleanUp() {
- toRemove.clear();
- synchronized (free_) {
- try {
- Iterator it_ = free_.iterator();
- while (it_.hasNext()) {
- PooledConnection tempPC = (PooledConnection) it_.next();
- Long timeOutVal = (Long) hashTab_.get(tempPC);
- if (System.currentTimeMillis() > timeOutVal.longValue()) {
- toRemove.add(tempPC);
- }
- }
- } catch (Throwable t) {
- if (T4Properties.t4GlobalLogger.isLoggable(Level.WARNING) == true) {
- T4Properties.t4GlobalLogger.logp(Level.WARNING, "IdleConnectionCleanupTask", "cleanUp", t
- .getMessage());
- }
- }
- } // synchronized block
- for (int i = 0; i < toRemove.size(); i++) {
- PooledConnection pc = (PooledConnection) toRemove.get(i);
- boolean wasPresent = removeFreeConnection(pc, false);
- if (wasPresent) {
- // close it to cleanup
- try {
- /*
- * System.out.println("Closing connection : " + (
- * (HPT4Connection) ( (HPT4PooledConnection)
- * pc).getConnection()).getDialogueId());
- */
- pc.close();
- } catch (SQLException se) {
- // Ignore
- }
- }
- }
- }
- }
-
- /* End TimerTask definition */
- /*
- * Private class used to clean up the connections that have surpassed
- * connectionTimeout
- */
- /* Start TimerTask definition */
- private class ConnectionTimeoutCleanupTask extends TimerTask {
- Vector toRemove = null;
-
- ConnectionTimeoutCleanupTask() {
- toRemove = new Vector();
- }
-
- public void run() {
- cleanUp();
- }
-
- private void cleanUp() {
- toRemove.clear();
- synchronized (inUse_) {
- Iterator it_ = inUse_.iterator();
- while (it_.hasNext()) {
- try {
- PooledConnection tempPC = (PooledConnection) it_.next();
- InterfaceConnection ic = ((HPT4PooledConnection) tempPC).getTrafT4ConnectionReference().ic_;
- if (ic != null) {
- T4Connection tconn = ic.getT4Connection();
- if (tconn != null) {
- if (tconn.connectionIdleTimeoutOccured()) {
- // System.out.println("********* Found a
- // timed out connection **********");
- toRemove.add(tempPC);
- }
- }
- }
- } catch (Throwable t) {
- if (T4Properties.t4GlobalLogger.isLoggable(Level.WARNING) == true) {
- T4Properties.t4GlobalLogger.logp(Level.WARNING, "ConnectionTimeoutCleanupTask", "cleanUp",
- t.getMessage());
- }
- }
- }
- } // synchronized block
- for (int i = 0; i < toRemove.size(); i++) {
- PooledConnection pc = (PooledConnection) toRemove.get(i);
- removeInUseConnection(pc, false);
- // do not close the connections because:
- // 1.> Corresponding NCS server is already gone
- // 2.> We need to give a timeout error when user uses this
- // connection
- }
- }
- }
- /* End TimerTask definition */
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ResultSetMetaData.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ResultSetMetaData.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ResultSetMetaData.java
deleted file mode 100644
index d1f1f7e..0000000
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/HPT4ResultSetMetaData.java
+++ /dev/null
@@ -1,309 +0,0 @@
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
-
-package org.trafodion.jdbc.t4;
-
-import java.sql.SQLException;
-import java.util.logging.Level;
-
-public class HPT4ResultSetMetaData implements java.sql.ResultSetMetaData {
-
- // begin required methods
- public String getCatalogName(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].catalogName_;
- }
-
- public String getColumnClassName(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].getColumnClassName();
- }
-
- public int getColumnCount() throws SQLException {
- return outputDesc_.length;
- }
-
- public int getColumnDisplaySize(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].displaySize_;
- }
-
- public String getColumnLabel(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
-
- return (outputDesc_[column - 1].columnLabel_ == null) ? outputDesc_[column - 1].name_
- : outputDesc_[column - 1].columnLabel_;
- }
-
- public String getColumnName(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].name_;
- }
-
- public int getColumnType(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].dataType_;
- }
-
- public String getColumnTypeName(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].getColumnTypeName(connection_.getLocale());
- }
-
- public int getPrecision(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].precision_;
- }
-
- public int getScale(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].scale_;
- }
-
- public String getSchemaName(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].schemaName_;
- }
-
- public String getTableName(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].tableName_;
- }
-
- public boolean isAutoIncrement(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].isAutoIncrement_;
- }
-
- public boolean isCaseSensitive(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].isCaseSensitive_;
- }
-
- public boolean isCurrency(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].isCurrency_;
- }
-
- public boolean isDefinitelyWritable(int column) throws SQLException {
- return true;
- }
-
- public int isNullable(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].isNullable_;
- }
-
- public boolean isReadOnly(int column) throws SQLException {
- return false;
- }
-
- public boolean isSearchable(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].isSearchable_;
- }
-
- public boolean isSigned(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].isSigned_;
- }
-
- public boolean isWritable(int column) throws SQLException {
- return true;
- }
-
- // ////////////////////////
- // begin custom accessors//
- // ////////////////////////
-
- public int getFSDataType(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].fsDataType_;
- }
-
- public int getMaxLength(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].maxLen_;
- }
-
- public int getOdbcCharset(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].odbcCharset_;
- }
-
- public int getRowLength() throws SQLException {
- // this is the same for all params
- // only if we have no input params will we throw an error
- if (outputDesc_.length == 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.props_.getLocale(),
- "invalid_desc_index", null);
- }
-
- return outputDesc_[0].rowLength_;
- }
-
- public int getSqlCharset(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].sqlCharset_;
- }
-
- public int getSqlPrecision(int column) throws SQLException {
- if (column > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].sqlPrecision_;
- }
-
- public int getSqlDatetimeCode(int param) throws SQLException {
- return stmt_.ist_.pr_.outputDesc[param - 1].datetimeCode_;
- }
-
- // /////////////////////////////////
- // these are legacy names...do not remove these yet even though they are
- // duplicate
- // ///////////////////////////////
-
- /**
- * @deprecated
- */
- public String cpqGetCharacterSet(int column) throws SQLException {
- if ((column > outputDesc_.length) || (column <= 0)) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_desc_index",
- null);
- }
- return outputDesc_[column - 1].getCharacterSetName();
- }
-
- /**
- * @deprecated
- */
- public int getSqlTypeCode(int param) throws SQLException {
- return stmt_.ist_.pr_.outputDesc[param - 1].dataType_;
- } // end getSqlTypeCode
-
- /**
- * @deprecated
- */
- public int getSqlLength(int param) throws SQLException {
- return stmt_.ist_.pr_.outputDesc[param - 1].maxLen_;
- } // end getSqlTypeCode
-
- HPT4ResultSetMetaData(TrafT4Statement stmt, HPT4Desc[] outputDesc) {
- if (stmt.connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(stmt.connection_.props_, stmt, outputDesc);
- stmt.connection_.props_.t4Logger_.logp(Level.FINE, "HPT4ResultSetMetaData", "", "", p);
- }
-
- connection_ = stmt.connection_;
- outputDesc_ = outputDesc;
- stmt_ = stmt;
- }
-
- HPT4ResultSetMetaData(TrafT4ResultSet resultSet, HPT4Desc[] outputDesc) {
- if (resultSet.connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
- Object p[] = T4LoggingUtilities.makeParams(resultSet.connection_.props_, resultSet, outputDesc);
- resultSet.connection_.props_.t4Logger_.logp(Level.FINE, "HPT4ResultSetMetaData", "", "", p);
- }
-
- resultSet_ = resultSet;
- connection_ = resultSet_.connection_;
- outputDesc_ = outputDesc;
- stmt_ = resultSet.stmt_;
- }
-
- TrafT4ResultSet resultSet_;
- TrafT4Connection connection_;
- HPT4Desc[] outputDesc_;
- TrafT4Statement stmt_;
- public Object unwrap(Class iface) throws SQLException {
- // TODO Auto-generated method stub
- return null;
- }
-
- public boolean isWrapperFor(Class iface) throws SQLException {
- // TODO Auto-generated method stub
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InitializeDialogueReply.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InitializeDialogueReply.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InitializeDialogueReply.java
index 5deb159..2d57f7b 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InitializeDialogueReply.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InitializeDialogueReply.java
@@ -76,12 +76,12 @@ class InitializeDialogueReply {
ic.outContext = new OUT_CONNECTION_CONTEXT_def();
ic.outContext.extractFromByteArray(buf, ic);
break;
- //throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_28_000", null);
+ //throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_28_000", null);
case odbc_SQLSvc_InitializeDialogue_ParamError_exn_:
ParamError = ic.decodeBytes(buf.extractString(), 1);
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_program_error", ParamError, addr);
case odbc_SQLSvc_InitializeDialogue_InvalidConnection_exn_:
- throw HPT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
+ throw TrafT4Messages.createSQLException(null, ic.getLocale(), "ids_08_s01", null);
default:
clientErrorText = "unknown_initialize_dialogue_reply_error";
break;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InputOutput.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InputOutput.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InputOutput.java
index 7062778..56111e9 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InputOutput.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InputOutput.java
@@ -260,7 +260,7 @@ class InputOutput {
// representitive of the problem
// with all addresses.
//
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "socket_open_error", eFirst
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "socket_open_error", eFirst
.getMessage());
se.initCause(eFirst);
@@ -373,8 +373,8 @@ class InputOutput {
// We didn't even get the header back, so something is seriously
// wrong.
//
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "problem_with_server_read", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "header_not_long_enough", null);
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "problem_with_server_read", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "header_not_long_enough", null);
se.setNextException(se2);
throw se;
@@ -393,8 +393,8 @@ class InputOutput {
buffer.setByteSwap(true);
break;
default:
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "problem_with_server_read", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "wrong_header_version", String.valueOf(m_rheader.version_));
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "problem_with_server_read", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "wrong_header_version", String.valueOf(m_rheader.version_));
se.setNextException(se2);
throw se;
@@ -402,8 +402,8 @@ class InputOutput {
}
if (m_rheader.signature_ != Header.SIGNATURE) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "problem_with_server_read", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "wrong_header_signature", String
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "problem_with_server_read", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "wrong_header_signature", String
.valueOf(Header.SIGNATURE), String.valueOf(m_rheader.signature_));
se.setNextException(se2);
@@ -411,7 +411,7 @@ class InputOutput {
}
if (m_rheader.error_ != 0) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "driver_err_error_from_server", String
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "driver_err_error_from_server", String
.valueOf(m_rheader.error_), String.valueOf(m_rheader.error_detail_));
throw se;
@@ -450,7 +450,7 @@ class InputOutput {
m_socket.close();
m_socket = null;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "session_close_error", e.getMessage());
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "session_close_error", e.getMessage());
se.initCause(e);
throw se;
} finally {
@@ -461,8 +461,8 @@ class InputOutput {
void TCPIPWriteByteBuffer(ByteBuffer buffer) throws SQLException {
if (m_socket == null) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "socket_write_error", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "socket_is_closed_error", null);
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "socket_write_error", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "socket_is_closed_error", null);
se.setNextException(se2);
throw se;
@@ -472,7 +472,7 @@ class InputOutput {
m_wbc.write(buffer);
m_os.flush();
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "socket_write_error", e.getMessage());
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "socket_write_error", e.getMessage());
se.initCause(e);
throw se;
@@ -490,8 +490,8 @@ class InputOutput {
int data_length = 0;
if (m_socket == null) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "socket_write_error", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "socket_is_closed_error", null);
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "socket_write_error", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "socket_is_closed_error", null);
se.setNextException(se2);
throw se;
@@ -508,9 +508,9 @@ class InputOutput {
send_nblk(buffer.getBuffer(), buffer_index, data_length);
break;
default:
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "unknown_message_type_error", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "internal_error", null);
- SQLException se3 = HPT4Messages.createSQLException(null, m_locale, "cntact_hp_error", null);
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "unknown_message_type_error", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "internal_error", null);
+ SQLException se3 = TrafT4Messages.createSQLException(null, m_locale, "cntact_traf_error", null);
se.setNextException(se2);
se2.setNextException(se3);
@@ -525,8 +525,8 @@ class InputOutput {
int numRead = 0;
if (m_socket == null) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "socket_read_error", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "socket_is_closed_error", null);
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "socket_read_error", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "socket_is_closed_error", null);
se.setNextException(se2);
throw se;
@@ -539,9 +539,9 @@ class InputOutput {
// buffer.setLocation(numRead);
break;
default:
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "unknown_message_type_error", null);
- SQLException se2 = HPT4Messages.createSQLException(null, m_locale, "internal_error", null);
- SQLException se3 = HPT4Messages.createSQLException(null, m_locale, "cntact_hp_error", null);
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "unknown_message_type_error", null);
+ SQLException se2 = TrafT4Messages.createSQLException(null, m_locale, "internal_error", null);
+ SQLException se3 = TrafT4Messages.createSQLException(null, m_locale, "cntact_traf_error", null);
se.setNextException(se2);
se2.setNextException(se3);
@@ -558,7 +558,7 @@ class InputOutput {
m_os.write(buf, offset, len);
m_os.flush();
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "socket_write_error", e.getMessage());
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "socket_write_error", e.getMessage());
se.initCause(e);
throw se;
@@ -602,13 +602,13 @@ class InputOutput {
throw ste;
} catch (Exception e) {
- SQLException se = HPT4Messages
+ SQLException se = TrafT4Messages
.createSQLException(null, m_locale, "session_close_error", e.getMessage());
se.initCause(e);
throw se;
}
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(null, m_locale, "socket_read_error", e.getMessage());
+ SQLException se = TrafT4Messages.createSQLException(null, m_locale, "socket_read_error", e.getMessage());
se.initCause(e);
throw se;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceConnection.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceConnection.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceConnection.java
index 4c1877f..b3c7f03 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceConnection.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceConnection.java
@@ -136,7 +136,7 @@ class InterfaceConnection {
gcConnections();
if (t4props.getSQLException() != null) {
- throw HPT4Messages.createSQLException(t4props_, t4props.getLocale(), "invalid_property", t4props
+ throw TrafT4Messages.createSQLException(t4props_, t4props.getLocale(), "invalid_property", t4props
.getSQLException());
}
@@ -357,7 +357,7 @@ class InterfaceConnection {
try {
authentication = pwd.getBytes("US-ASCII");
} catch (UnsupportedEncodingException uex) {
- throw HPT4Messages.createSQLException(t4props_, locale, uex.getMessage(), null);
+ throw TrafT4Messages.createSQLException(t4props_, locale, uex.getMessage(), null);
}
if (authentication.length > 0) {
@@ -505,7 +505,7 @@ class InterfaceConnection {
String temp = errorText;
t4props_.t4Logger_.logp(Level.FINEST, "InterfaceConnection", "cancel", temp, p);
}
- throw HPT4Messages.createSQLException(t4props_, locale, "as_cancel_message_error", errorText);
+ throw TrafT4Messages.createSQLException(t4props_, locale, "as_cancel_message_error", errorText);
} // end switch
currentTime = (new java.util.Date()).getTime();
@@ -538,9 +538,9 @@ class InterfaceConnection {
// exceptions.
//
int sc = se.getErrorCode();
- int s1 = HPT4Messages.createSQLException(t4props_, locale, "socket_open_error", null).getErrorCode();
- int s2 = HPT4Messages.createSQLException(t4props_, locale, "socket_write_error", null).getErrorCode();
- int s3 = HPT4Messages.createSQLException(t4props_, locale, "socket_read_error", null).getErrorCode();
+ int s1 = TrafT4Messages.createSQLException(t4props_, locale, "socket_open_error", null).getErrorCode();
+ int s2 = TrafT4Messages.createSQLException(t4props_, locale, "socket_write_error", null).getErrorCode();
+ int s3 = TrafT4Messages.createSQLException(t4props_, locale, "socket_read_error", null).getErrorCode();
if (sc == s1 || sc == s2 || sc == s3) {
if (t4props_.t4Logger_.isLoggable(Level.INFO)) {
@@ -585,10 +585,10 @@ class InterfaceConnection {
if (ex_nr_d == odbc_SQLSvc_InitializeDialogue_exc_.SQL_PASSWORD_EXPIRING ||
ex_nr_d == odbc_SQLSvc_InitializeDialogue_exc_.SQL_PASSWORD_GRACEPERIOD) {
- HPT4Messages.setSQLWarning(this.t4props_, this._t4Conn, idr.SQLError);
+ TrafT4Messages.setSQLWarning(this.t4props_, this._t4Conn, idr.SQLError);
done = true;
} else {
- HPT4Messages.throwSQLException(t4props_, idr.SQLError);
+ TrafT4Messages.throwSQLException(t4props_, idr.SQLError);
}
}
}
@@ -606,12 +606,12 @@ class InterfaceConnection {
}
if (currentTime >= endTime) {
- se1 = HPT4Messages.createSQLException(t4props_, locale, "ids_s1_t00", null);
+ se1 = TrafT4Messages.createSQLException(t4props_, locale, "ids_s1_t00", null);
} else if (tryNum >= retryCount) {
- se1 = HPT4Messages.createSQLException(t4props_, locale, "as_connect_message_error",
+ se1 = TrafT4Messages.createSQLException(t4props_, locale, "as_connect_message_error",
"exceeded retry count");
} else {
- se1 = HPT4Messages.createSQLException(t4props_, locale, "as_connect_message_error", null);
+ se1 = TrafT4Messages.createSQLException(t4props_, locale, "as_connect_message_error", null);
}
throw se1;
}
@@ -744,7 +744,7 @@ class InterfaceConnection {
initDiag(true,true);
}catch(SQLException e) {
if(outContext == null || outContext.certificate == null) {
- SQLException he = HPT4Messages.createSQLException(t4props_, this.locale, "certificate_download_error", e.getMessage());
+ SQLException he = TrafT4Messages.createSQLException(t4props_, this.locale, "certificate_download_error", e.getMessage());
he.setNextException(e);
throw he;
}
@@ -801,7 +801,7 @@ class InterfaceConnection {
if (!cr.m_p4_dataSource.equals(t4props_.getServerDataSource())) {
Object[] messageArguments = new Object[1];
messageArguments[0] = cr.m_p4_dataSource;
- sqlwarning_ = HPT4Messages.createSQLWarning(t4props_, "connected_to_Default_DS", messageArguments);
+ sqlwarning_ = TrafT4Messages.createSQLWarning(t4props_, "connected_to_Default_DS", messageArguments);
}
break;
case odbc_Dcs_GetObjRefHdl_exc_.odbc_Dcs_GetObjRefHdl_ASTryAgain_exn_:
@@ -856,7 +856,7 @@ class InterfaceConnection {
errorText = errorText + " :" + "Error text = " + cr.m_p1_exception.ErrorText;
}
- throw HPT4Messages.createSQLException(t4props_, locale, "as_connect_message_error", errorText);
+ throw TrafT4Messages.createSQLException(t4props_, locale, "as_connect_message_error", errorText);
}
if (done == false && t4props_.t4Logger_.isLoggable(Level.INFO)) {
@@ -872,11 +872,11 @@ class InterfaceConnection {
SQLException se2;
if (currentTime >= endTime) {
- se1 = HPT4Messages.createSQLException(t4props_, locale, "ids_s1_t00", null);
- se2 = HPT4Messages.createSQLException(t4props_, locale, errorMsg, errorMsg_detail);
+ se1 = TrafT4Messages.createSQLException(t4props_, locale, "ids_s1_t00", null);
+ se2 = TrafT4Messages.createSQLException(t4props_, locale, errorMsg, errorMsg_detail);
se1.setNextException(se2);
} else {
- se1 = HPT4Messages.createSQLException(t4props_, locale, errorMsg, errorMsg_detail);
+ se1 = TrafT4Messages.createSQLException(t4props_, locale, errorMsg, errorMsg_detail);
}
throw se1;
@@ -912,14 +912,14 @@ class InterfaceConnection {
// @deprecated
void isConnectionClosed() throws SQLException {
if (isClosed_ == false) {
- throw HPT4Messages.createSQLException(t4props_, locale, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(t4props_, locale, "invalid_connection", null);
}
}
// @deprecated
void isConnectionOpen() throws SQLException {
if (isClosed_) {
- throw HPT4Messages.createSQLException(t4props_, locale, "invalid_connection", null);
+ throw TrafT4Messages.createSQLException(t4props_, locale, "invalid_connection", null);
}
}
@@ -1021,7 +1021,7 @@ class InterfaceConnection {
// do the warning processing
if (scr_.m_p2.length != 0) {
- HPT4Messages.setSQLWarning(conn.props_, conn, scr_.m_p2);
+ TrafT4Messages.setSQLWarning(conn.props_, conn, scr_.m_p2);
}
if (t4props_.t4Logger_.isLoggable(Level.FINEST) == true) {
Object p[] = T4LoggingUtilities.makeParams(conn.props_, attr, valueNum, valueString);
@@ -1035,14 +1035,14 @@ class InterfaceConnection {
String temp = "odbc_SQLSvc_SetConnectionOption_SQLError_exn_ occurred.";
t4props_.t4Logger_.logp(Level.FINEST, "InterfaceConnection", "setConnectionAttr", temp, p);
}
- HPT4Messages.throwSQLException(t4props_, scr_.m_p1.errorList);
+ TrafT4Messages.throwSQLException(t4props_, scr_.m_p1.errorList);
default:
if (t4props_.t4Logger_.isLoggable(Level.FINEST) == true) {
Object p[] = T4LoggingUtilities.makeParams(conn.props_, attr, valueNum, valueString);
String temp = "UnknownException occurred.";
t4props_.t4Logger_.logp(Level.FINEST, "InterfaceConnection", "setConnectionAttr", temp, p);
}
- throw HPT4Messages.createSQLException(conn.props_, locale, "ids_unknown_reply_error", null);
+ throw TrafT4Messages.createSQLException(conn.props_, locale, "ids_unknown_reply_error", null);
}
};
@@ -1057,7 +1057,7 @@ class InterfaceConnection {
if (level != Connection.TRANSACTION_NONE && level != Connection.TRANSACTION_READ_COMMITTED
&& level != Connection.TRANSACTION_READ_UNCOMMITTED && level != Connection.TRANSACTION_REPEATABLE_READ
&& level != Connection.TRANSACTION_SERIALIZABLE) {
- throw HPT4Messages.createSQLException(conn.props_, locale, "invalid_transaction_isolation", null);
+ throw TrafT4Messages.createSQLException(conn.props_, locale, "invalid_transaction_isolation", null);
}
txnIsolationLevel = level;
@@ -1215,7 +1215,7 @@ class InterfaceConnection {
void endTransaction(short commitOption) throws SQLException {
EndTransactionReply etr_ = null;
if (autoCommit && !_t4Conn.isBeginTransaction()) {
- throw HPT4Messages.createSQLException(t4props_, locale, "invalid_commit_mode", null);
+ throw TrafT4Messages.createSQLException(t4props_, locale, "invalid_commit_mode", null);
}
isConnectionOpen();
@@ -1242,7 +1242,7 @@ class InterfaceConnection {
String temp = "odbc_SQLSvc_EndTransaction_ParamError_exn_ :";
t4props_.t4Logger_.logp(Level.FINEST, "InterfaceConnection", "endTransaction", temp, p);
}
- throw HPT4Messages.createSQLException(t4props_, locale, "ParamError:" + etr_.m_p1.ParamError, null);
+ throw TrafT4Messages.createSQLException(t4props_, locale, "ParamError:" + etr_.m_p1.ParamError, null);
case odbc_SQLSvc_EndTransaction_exc_.odbc_SQLSvc_EndTransaction_InvalidConnection_exn_:
if (t4props_.t4Logger_.isLoggable(Level.FINEST) == true) {
Object p[] = T4LoggingUtilities.makeParams(t4props_, commitOption);
@@ -1256,7 +1256,7 @@ class InterfaceConnection {
String temp = "odbc_SQLSvc_EndTransaction_SQLError_exn_:" + etr_.m_p1.SQLError;
t4props_.t4Logger_.logp(Level.FINEST, "InterfaceConnection", "endTransaction", temp, p);
}
- HPT4Messages.throwSQLException(t4props_, etr_.m_p1.SQLError);
+ TrafT4Messages.throwSQLException(t4props_, etr_.m_p1.SQLError);
case odbc_SQLSvc_EndTransaction_exc_.odbc_SQLSvc_EndTransaction_SQLInvalidHandle_exn_:
if (t4props_.t4Logger_.isLoggable(Level.FINEST) == true) {
Object p[] = T4LoggingUtilities.makeParams(t4props_, commitOption);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceResultSet.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceResultSet.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceResultSet.java
index 8dbbc2f..2d2390b 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceResultSet.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceResultSet.java
@@ -173,7 +173,7 @@ class InterfaceResultSet {
break;
case SQLDTCODE_TIME:
if (ODBCDataType == java.sql.Types.OTHER) // For
- // HPT4Desc.SQLDTCODE_HOUR_TO_FRACTION
+ // TrafT4Desc.SQLDTCODE_HOUR_TO_FRACTION
{
allocLength = SQLOctetLength;
} else {
@@ -250,13 +250,13 @@ class InterfaceResultSet {
case SQLDTCODE_TIME:
// Need to add code here to check if it's
- // HPT4Desc.SQLDTCODE_HOUR_TO_FRACTION
+ // TrafT4Desc.SQLDTCODE_HOUR_TO_FRACTION
if (ODBCDataType != java.sql.Types.OTHER) {
retObj = Time.valueOf(tmpStr);
break;
} else {
// Do default processing as it is
- // HPT4Desc.SQLDTCODE_HOUR_TO_FRACTION
+ // TrafT4Desc.SQLDTCODE_HOUR_TO_FRACTION
}
default:
retObj = tmpStr;
@@ -311,7 +311,7 @@ class InterfaceResultSet {
tmpStr = String.valueOf(Bytes.extractLong(ibuffer, byteIndex, this.ic_.getByteSwap()));
break;
default:
- throw HPT4Messages.createSQLException(conn.props_, conn.getLocale(), "restricted_data_type", null);
+ throw TrafT4Messages.createSQLException(conn.props_, conn.getLocale(), "restricted_data_type", null);
}
retObj = new BigDecimal((new BigInteger(tmpStr)), scale);
break;
@@ -344,7 +344,7 @@ class InterfaceResultSet {
case SQLTYPECODE_BITVAR:
case SQLTYPECODE_BPINT_UNSIGNED:
default:
- throw HPT4Messages.createSQLException(conn.props_, conn.getLocale(), "restricted_data_type", null);
+ throw TrafT4Messages.createSQLException(conn.props_, conn.getLocale(), "restricted_data_type", null);
}
return retObj;
} // end getFetchString
@@ -360,7 +360,7 @@ class InterfaceResultSet {
// -------------------------------------------------------------------
// get the column value data from Execute2 in String format
- static Object getExecute2FetchString(TrafT4Connection conn, HPT4Desc desc, byte[] values, int noNullValue,
+ static Object getExecute2FetchString(TrafT4Connection conn, TrafT4Desc desc, byte[] values, int noNullValue,
int ODBCDataType, boolean useOldDateFormat, boolean swap) throws SQLException {
Object retObj;
String tmpStr;
@@ -452,7 +452,7 @@ class InterfaceResultSet {
case SQLDTCODE_TIME:
if (ODBCDataType == java.sql.Types.OTHER) // For
- // HPT4Desc.SQLDTCODE_HOUR_TO_FRACTION
+ // TrafT4Desc.SQLDTCODE_HOUR_TO_FRACTION
{
length = desc.sqlOctetLength_;
retObj = new String(Bytes.read_chars(values, noNullValue, length));
@@ -573,7 +573,7 @@ class InterfaceResultSet {
case SQLTYPECODE_BITVAR:
case SQLTYPECODE_BPINT_UNSIGNED:
default:
- throw HPT4Messages.createSQLException(conn.props_, conn.getLocale(), "restricted_data_type", null);
+ throw TrafT4Messages.createSQLException(conn.props_, conn.getLocale(), "restricted_data_type", null);
}
return retObj;
} // end getExecute2FetchString
@@ -661,7 +661,7 @@ class InterfaceResultSet {
}
if (columnValue == null) {
- throw HPT4Messages
+ throw TrafT4Messages
.createSQLException(rs.connection_.props_, ic_.getLocale(), "null_data", null);
}
} else {
@@ -729,7 +729,7 @@ class InterfaceResultSet {
columnValue = getExecute2FetchString(rs.connection_, rs.outputDesc_[columnIndex], values,
noNullValueOffset, rs.outputDesc_[columnIndex].dataType_, rs.useOldDateFormat(), this.ic_.getByteSwap());
if (columnValue == null) {
- throw HPT4Messages
+ throw TrafT4Messages
.createSQLException(rs.connection_.props_, ic_.getLocale(), "null_data", null);
}
} // end if else
@@ -791,7 +791,7 @@ class InterfaceResultSet {
// do warning processing
if (fr.errorList.length != 0) {
- HPT4Messages.setSQLWarning(rs.connection_.props_, rs, fr.errorList);
+ TrafT4Messages.setSQLWarning(rs.connection_.props_, rs, fr.errorList);
}
//endOfData = (fr.rowsAffected < maxRowCnt) ? true : false;
@@ -818,7 +818,7 @@ class InterfaceResultSet {
break;
default:
- HPT4Messages.throwSQLException(rs.connection_.props_, fr.errorList);
+ TrafT4Messages.throwSQLException(rs.connection_.props_, fr.errorList);
}
@@ -865,14 +865,14 @@ class InterfaceResultSet {
rs_.connection_.props_.t4Logger_.logp(Level.FINEST, "InterfaceResultSet", "close", temp, p);
}
- HPT4Messages.throwSQLException(rs_.connection_.props_, cry_.m_p1.SQLError);
+ TrafT4Messages.throwSQLException(rs_.connection_.props_, cry_.m_p1.SQLError);
default:
if (ic_.t4props_.t4Logger_.isLoggable(Level.FINEST) == true) {
Object p[] = T4LoggingUtilities.makeParams(rs_.connection_.props_);
String temp = "UnknownException occurred during close.";
rs_.connection_.props_.t4Logger_.logp(Level.FINEST, "InterfaceResultSet", "close", temp, p);
}
- throw HPT4Messages.createSQLException(rs_.connection_.props_, ic_.getLocale(),
+ throw TrafT4Messages.createSQLException(rs_.connection_.props_, ic_.getLocale(),
"ids_unknown_reply_error", null);
} // end switch
} // end if
@@ -885,7 +885,7 @@ class InterfaceResultSet {
};
// ----------------------------------------------------------------------------
- static Object[] getExecute2Outputs(TrafT4Connection conn, HPT4Desc[] desc, byte[] values, boolean swap) throws SQLException
+ static Object[] getExecute2Outputs(TrafT4Connection conn, TrafT4Desc[] desc, byte[] values, boolean swap) throws SQLException
{
Object[] columnArray;
@@ -907,13 +907,13 @@ class InterfaceResultSet {
}
if ((nullValueOffset != -1 && Bytes.extractShort(values, nullValueOffset, swap) == -1)
- || (desc[columnIndex].paramMode_ == HPT4ParameterMetaData.parameterModeIn)) {
+ || (desc[columnIndex].paramMode_ == TrafT4ParameterMetaData.parameterModeIn)) {
columnValue = null;
} else {
columnValue = getExecute2FetchString(conn, desc[columnIndex], values, noNullValueOffset,
desc[columnIndex].dataType_, false, swap);
if (columnValue == null) {
- throw HPT4Messages.createSQLException(conn.props_, conn.getLocale(), "null_data", null);
+ throw TrafT4Messages.createSQLException(conn.props_, conn.getLocale(), "null_data", null);
}
} // end if else
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
index e6c7af8..153394d 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
@@ -138,7 +138,7 @@ class InterfaceStatement {
if (paramValue == null) {
if (nullValue == -1) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale,
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale,
"null_parameter_for_not_null_column", new Integer(paramNumber));
}
@@ -172,12 +172,12 @@ class InterfaceStatement {
}
tmpBarray = ((String) paramValue).getBytes(charSet);
} catch (Exception e) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
charSet);
}
} // end if (paramValue instanceof String)
else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
"CHAR data should be either bytes or String for column: " + paramNumber);
}
@@ -203,7 +203,7 @@ class InterfaceStatement {
}
}
} else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_string_parameter",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_string_parameter",
"CHAR input data is longer than the length for column: " + paramNumber);
}
@@ -227,13 +227,13 @@ class InterfaceStatement {
}
tmpBarray = ((String) paramValue).getBytes(charSet);
} catch (Exception e) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
charSet);
}
} // end if (paramValue instanceof String)
else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
"VARCHAR data should be either bytes or String for column: " + paramNumber);
}
@@ -242,7 +242,7 @@ class InterfaceStatement {
Bytes.insertShort(values, noNullValue, (short) dataLen, this.ic_.getByteSwap());
System.arraycopy(tmpBarray, 0, values, noNullValue + 2, dataLen);
} else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
"VARCHAR input data is longer than the length for column: " + paramNumber);
}
break;
@@ -260,7 +260,7 @@ class InterfaceStatement {
throw new IllegalArgumentException();
}
} catch (IllegalArgumentException iex) {
- throw HPT4Messages
+ throw TrafT4Messages
.createSQLException(
pstmt.connection_.props_,
locale,
@@ -274,7 +274,7 @@ class InterfaceStatement {
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
messageArguments);
}
break;
@@ -283,7 +283,7 @@ class InterfaceStatement {
try {
tmpts = Timestamp.valueOf((String) paramValue);
} catch (IllegalArgumentException iex) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
"Timestamp data format is incorrect for column: " + paramNumber + " = " + paramValue);
}
@@ -295,7 +295,7 @@ class InterfaceStatement {
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
messageArguments);
}
dataLen = tmpBarray.length;
@@ -326,54 +326,54 @@ class InterfaceStatement {
byte[] tempb1 = tmptime.toString().getBytes("ASCII");
System.arraycopy(tempb1, 0, values, noNullValue, tempb1.length);
} catch (IllegalArgumentException iex) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale,
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale,
"invalid_parameter_value", "Time data format is incorrect for column: " + paramNumber
+ " = " + paramValue);
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
messageArguments);
}
break;
} else {
- // HPT4Desc.SQLDTCODE_HOUR_TO_FRACTION data type!!!
+ // TrafT4Desc.SQLDTCODE_HOUR_TO_FRACTION data type!!!
// let the next case structure handle it
}
- case HPT4Desc.SQLDTCODE_YEAR:
- case HPT4Desc.SQLDTCODE_YEAR_TO_MONTH:
- case HPT4Desc.SQLDTCODE_MONTH:
- case HPT4Desc.SQLDTCODE_MONTH_TO_DAY:
- case HPT4Desc.SQLDTCODE_DAY:
- case HPT4Desc.SQLDTCODE_HOUR:
- case HPT4Desc.SQLDTCODE_HOUR_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_MINUTE:
- case HPT4Desc.SQLDTCODE_MINUTE_TO_SECOND:
- // case HPT4Desc.SQLDTCODE_MINUTE_TO_FRACTION:
- case HPT4Desc.SQLDTCODE_SECOND:
- // case HPT4Desc.SQLDTCODE_SECOND_TO_FRACTION:
- case HPT4Desc.SQLDTCODE_YEAR_TO_HOUR:
- case HPT4Desc.SQLDTCODE_YEAR_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_MONTH_TO_HOUR:
- case HPT4Desc.SQLDTCODE_MONTH_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_MONTH_TO_SECOND:
- // case HPT4Desc.SQLDTCODE_MONTH_TO_FRACTION:
- case HPT4Desc.SQLDTCODE_DAY_TO_HOUR:
- case HPT4Desc.SQLDTCODE_DAY_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_DAY_TO_SECOND:
- // case HPT4Desc.SQLDTCODE_DAY_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_YEAR:
+ case TrafT4Desc.SQLDTCODE_YEAR_TO_MONTH:
+ case TrafT4Desc.SQLDTCODE_MONTH:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_DAY:
+ case TrafT4Desc.SQLDTCODE_DAY:
+ case TrafT4Desc.SQLDTCODE_HOUR:
+ case TrafT4Desc.SQLDTCODE_HOUR_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MINUTE_TO_SECOND:
+ // case TrafT4Desc.SQLDTCODE_MINUTE_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_SECOND:
+ // case TrafT4Desc.SQLDTCODE_SECOND_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_YEAR_TO_HOUR:
+ case TrafT4Desc.SQLDTCODE_YEAR_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_HOUR:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_SECOND:
+ // case TrafT4Desc.SQLDTCODE_MONTH_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_DAY_TO_HOUR:
+ case TrafT4Desc.SQLDTCODE_DAY_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_DAY_TO_SECOND:
+ // case TrafT4Desc.SQLDTCODE_DAY_TO_FRACTION:
default:
if (paramValue instanceof String) {
try {
tmpBarray = ((String) paramValue).getBytes("ASCII");
} catch (Exception e) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
"ASCII");
}
} else if (paramValue instanceof byte[]) {
tmpBarray = (byte[]) paramValue;
} else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale,
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale,
"invalid_cast_specification", "DATETIME data should be either bytes or String for column: "
+ paramNumber);
}
@@ -386,7 +386,7 @@ class InterfaceStatement {
// Don't know when we need this. padding blanks. Legacy??
Arrays.fill(values, (noNullValue + dataLen), (noNullValue + maxLength), (byte) ' ');
} else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
"DATETIME data longer than column length: " + paramNumber);
}
break;
@@ -399,11 +399,11 @@ class InterfaceStatement {
try {
tmpBarray = ((String) paramValue).getBytes("ASCII");
} catch (Exception e) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
"ASCII");
}
} else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_cast_specification",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_cast_specification",
"INTERVAL data should be either bytes or String for column: " + paramNumber);
}
@@ -419,7 +419,7 @@ class InterfaceStatement {
Arrays.fill(values, (noNullValue + dataLen), (noNullValue + maxLength), (byte) ' ');
}
} else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
"INTERVAL data longer than column length: " + paramNumber);
}
@@ -446,12 +446,12 @@ class InterfaceStatement {
}
tmpBarray = ((String) paramValue).getBytes(charSet);
} catch (Exception e) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
charSet);
}
} // end if (paramValue instanceof String)
else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_cast_specification",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_cast_specification",
"VARCHAR data should be either bytes or String for column: " + paramNumber);
}
@@ -466,7 +466,7 @@ class InterfaceStatement {
}
System.arraycopy(tmpBarray, 0, values, (noNullValue + dataOffset), dataLen);
} else {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_string_parameter",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_string_parameter",
"VARCHAR data longer than column length: " + paramNumber);
}
break;
@@ -580,11 +580,11 @@ class InterfaceStatement {
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "unsupported_encoding",
messageArguments);
}
} catch (NumberFormatException nex) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
"DECIMAL data format incorrect for column: " + paramNumber + ". Error is: " + nex.getMessage());
}
@@ -607,7 +607,7 @@ class InterfaceStatement {
// DataTruncation is happening.
if (numOfZeros < 0) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "data_truncation_exceed", new int[]{dataLen, maxLength});
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "data_truncation_exceed", new int[]{dataLen, maxLength});
}
for (i = 0; i < numOfZeros; i++) {
@@ -661,7 +661,7 @@ class InterfaceStatement {
ic_.t4props_.t4Logger_.logp(Level.FINEST, "InterfaceStatement", "convertObjectToSQL2", temp, p);
}
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, locale, "restricted_data_type", null);
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "restricted_data_type", null);
}
if (ic_.t4props_.t4Logger_.isLoggable(Level.FINEST) == true) {
Object p[] = T4LoggingUtilities
@@ -735,7 +735,7 @@ class InterfaceStatement {
try {
convertObjectToSQL2(locale, stmt, paramValues[row * paramCount + col], paramRowCount, col,
dataValue.buffer, row - clientErrors.size());
- } catch (HPT4Exception e) {
+ } catch (TrafT4Exception e) {
if (paramRowCount == 1) // for single rows we need to
// throw immediately
throw e;
@@ -958,40 +958,40 @@ class InterfaceStatement {
}
// -------------------------------------------------------------
- static HPT4Desc[] NewDescArray(SQLItemDescList_def desc) {
+ static TrafT4Desc[] NewDescArray(SQLItemDescList_def desc) {
int index;
- HPT4Desc[] HPT4DescArray;
+ TrafT4Desc[] trafT4DescArray;
SQLItemDesc_def SQLDesc;
if (desc.list == null || desc.list.length == 0) {
return null;
}
- HPT4DescArray = new HPT4Desc[desc.list.length];
+ trafT4DescArray = new TrafT4Desc[desc.list.length];
for (index = 0; index < desc.list.length; index++) {
SQLDesc = desc.list[index];
boolean nullInfo = (((new Byte(SQLDesc.nullInfo)).shortValue()) == 1) ? true : false;
boolean signType = (((new Byte(SQLDesc.signType)).shortValue()) == 1) ? true : false;
- HPT4DescArray[index] = new HPT4Desc(SQLDesc.dataType, (short) SQLDesc.datetimeCode, SQLDesc.maxLen,
+ trafT4DescArray[index] = new TrafT4Desc(SQLDesc.dataType, (short) SQLDesc.datetimeCode, SQLDesc.maxLen,
SQLDesc.precision, SQLDesc.scale, nullInfo, SQLDesc.colHeadingNm, signType, SQLDesc.ODBCDataType,
SQLDesc.ODBCPrecision, SQLDesc.SQLCharset, SQLDesc.ODBCCharset, SQLDesc.CatalogName,
SQLDesc.SchemaName, SQLDesc.TableName, SQLDesc.dataType, SQLDesc.intLeadPrec, SQLDesc.paramMode);
}
- return HPT4DescArray;
+ return trafT4DescArray;
}
// -------------------------------------------------------------
- static HPT4Desc[] NewDescArray(Descriptor2[] descArray) {
+ static TrafT4Desc[] NewDescArray(Descriptor2[] descArray) {
int index;
- HPT4Desc[] HPT4DescArray;
+ TrafT4Desc[] trafT4DescArray;
Descriptor2 desc;
if (descArray == null || descArray.length == 0) {
return null;
}
- HPT4DescArray = new HPT4Desc[descArray.length];
+ trafT4DescArray = new TrafT4Desc[descArray.length];
for (index = 0; index < descArray.length; index++) {
desc = descArray[index];
@@ -1005,13 +1005,13 @@ class InterfaceStatement {
signType = true;
}
- HPT4DescArray[index] = new HPT4Desc(desc.noNullValue_, desc.nullValue_, desc.version_, desc.dataType_,
+ trafT4DescArray[index] = new TrafT4Desc(desc.noNullValue_, desc.nullValue_, desc.version_, desc.dataType_,
(short) desc.datetimeCode_, desc.maxLen_, (short) desc.precision_, (short) desc.scale_, nullInfo,
signType, desc.odbcDataType_, desc.odbcPrecision_, desc.sqlCharset_, desc.odbcCharset_,
desc.colHeadingNm_, desc.tableName_, desc.catalogName_, desc.schemaName_, desc.headingName_,
desc.intLeadPrec_, desc.paramMode_, desc.dataType_, desc.getRowLength());
}
- return HPT4DescArray;
+ return trafT4DescArray;
}
// -------------------------------------------------------------
@@ -1049,9 +1049,9 @@ class InterfaceStatement {
// ignore the SQLWarning for the static close
break;
case odbc_SQLSvc_Close_exc_.odbc_SQLSvc_Close_SQLError_exn_:
- HPT4Messages.throwSQLException(stmt_.connection_.props_, cry_.m_p1.SQLError);
+ TrafT4Messages.throwSQLException(stmt_.connection_.props_, cry_.m_p1.SQLError);
default:
- throw HPT4Messages.createSQLException(stmt_.connection_.props_, ic_.getLocale(), "ids_unknown_reply_error",
+ throw TrafT4Messages.createSQLException(stmt_.connection_.props_, ic_.getLocale(), "ids_unknown_reply_error",
null);
} // end switch
@@ -1091,10 +1091,10 @@ class InterfaceStatement {
txId = Bytes.createIntBytes(0, false);
if (sqlStmtType_ == TRANSPORT.TYPE_STATS) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, ic_.getLocale(), "infostats_invalid_error",
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, ic_.getLocale(), "infostats_invalid_error",
null);
} else if (sqlStmtType_ == TRANSPORT.TYPE_CONFIG) {
- throw HPT4Messages.createSQLException(pstmt.connection_.props_, ic_.getLocale(),
+ throw TrafT4Messages.createSQLException(pstmt.connection_.props_, ic_.getLocale(),
"config_cmd_invalid_error", null);
}
@@ -1108,13 +1108,13 @@ class InterfaceStatement {
switch (pr.returnCode) {
case TRANSPORT.SQL_SUCCESS:
case TRANSPORT.SQL_SUCCESS_WITH_INFO:
- HPT4Desc[] OutputDesc = InterfaceStatement.NewDescArray(pr.outputDesc);
- HPT4Desc[] InputDesc = InterfaceStatement.NewDescArray(pr.inputDesc);
+ TrafT4Desc[] OutputDesc = InterfaceStatement.NewDescArray(pr.outputDesc);
+ TrafT4Desc[] InputDesc = InterfaceStatement.NewDescArray(pr.inputDesc);
pstmt.setPrepareOutputs2(InputDesc, OutputDesc, pr.inputNumberParams, pr.outputNumberParams,
pr.inputParamLength, pr.outputParamLength, pr.inputDescLength, pr.outputDescLength);
if (pr.errorList != null && pr.errorList.length > 0) {
- HPT4Messages.setSQLWarning(stmt_.connection_.props_, pstmt, pr.errorList);
+ TrafT4Messages.setSQLWarning(stmt_.connection_.props_, pstmt, pr.errorList);
}
this.stmtHandle_ = pr.stmtHandle;
@@ -1124,7 +1124,7 @@ class InterfaceStatement {
case odbc_SQLSvc_Prepare_exc_.odbc_SQLSvc_Prepare_SQLError_exn_:
default:
- HPT4Messages.throwSQLException(stmt_.connection_.props_, pr.errorList);
+ TrafT4Messages.throwSQLException(stmt_.connection_.props_, pr.errorList);
}
if (ic_.t4props_.t4Logger_.isLoggable(Level.FINEST) == true) {
@@ -1325,11 +1325,11 @@ class InterfaceStatement {
}
// get the descriptors from the proper location
- HPT4Desc[][] desc = null;
+ TrafT4Desc[][] desc = null;
// try from execute data first
if (er.outputDesc != null && er.outputDesc.length > 0) {
- desc = new HPT4Desc[er.outputDesc.length][];
+ desc = new TrafT4Desc[er.outputDesc.length][];
for (int i = 0; i < er.outputDesc.length; i++) {
desc[i] = InterfaceStatement.NewDescArray(er.outputDesc[i]);
@@ -1337,7 +1337,7 @@ class InterfaceStatement {
}
// try from the prepare data
else if (stmt.outputDesc_ != null && stmt.outputDesc_.length > 0) {
- desc = new HPT4Desc[1][];
+ desc = new TrafT4Desc[1][];
desc[0] = stmt.outputDesc_;
}
@@ -1368,15 +1368,15 @@ class InterfaceStatement {
}
}
if (er.errorList != null) {
- HPT4Messages.setSQLWarning(stmt_.connection_.props_, stmt, er.errorList);
+ TrafT4Messages.setSQLWarning(stmt_.connection_.props_, stmt, er.errorList);
}
} else {
Arrays.fill(stmt.batchRowCount_, -3); // fill with failed
- HPT4Messages.throwSQLException(stmt_.connection_.props_, er.errorList);
+ TrafT4Messages.throwSQLException(stmt_.connection_.props_, er.errorList);
}
//3164
if (batchException) {
- HPT4Messages.throwSQLException(stmt_.connection_.props_, er.errorList);
+ TrafT4Messages.throwSQLException(stmt_.connection_.props_, er.errorList);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/NCSAddress.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/NCSAddress.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/NCSAddress.java
index a23c7e6..5e5b7a6 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/NCSAddress.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/NCSAddress.java
@@ -62,7 +62,7 @@ final class NCSAddress extends Address {
m_locale = locale;
if (addr == null) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_null_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_null_error", null);
throw se;
}
@@ -75,16 +75,16 @@ final class NCSAddress extends Address {
//
m_type = OS_type;
if (addr.endsWith(ODBCServerSuffix) == false) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "odbc_server_suffix_error",
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "odbc_server_suffix_error",
ODBCServerSuffix);
se.setNextException(se2);
throw se;
}
if (addr.length() < minODBCServerAddrLen) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "min_address_length_error",
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "min_address_length_error",
null);
se.setNextException(se2);
@@ -100,8 +100,8 @@ final class NCSAddress extends Address {
interpretAddress(t4props, locale, addr);
if ((m_machineName == null && m_ipAddress == null) || m_processName == null || m_portNumber == null) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "address_format_1_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_format_1_error", null);
se.setNextException(se2);
throw se;
@@ -125,8 +125,8 @@ final class NCSAddress extends Address {
int index2 = addr.lastIndexOf(".", index3);
if ((-1 < index1 && index1 < index2 && index2 < index3 && index3 < addr.length()) == false) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "address_format_1_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_format_1_error", null);
se.setNextException(se2);
throw se;
@@ -162,8 +162,8 @@ final class NCSAddress extends Address {
int index2 = addr.indexOf(".", 0);
if ((/*-1 < index1 && index1 < index2 &&*/ index2 < index4 && index4 < index3 && index3 < addr.length()) == false) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "address_format_1_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_format_1_error", null);
se.setNextException(se2);
throw se;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/PreparedStatementManager.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/PreparedStatementManager.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/PreparedStatementManager.java
index 801a4b1..9ca149b 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/PreparedStatementManager.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/PreparedStatementManager.java
@@ -28,7 +28,7 @@ import java.util.Hashtable;
import java.util.Iterator;
import java.util.logging.Level;
-public abstract class PreparedStatementManager extends HPT4Handle {
+public abstract class PreparedStatementManager extends TrafT4Handle {
boolean isStatementCachingEnabled() {
if (maxStatements_ < 1) {
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Address.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Address.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Address.java
index 6cc2085..2bc145c 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Address.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Address.java
@@ -66,7 +66,7 @@ final class T4Address extends Address {
super(t4props, locale, addr);
if (addr == null) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_null_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_null_error", null);
throw se;
}
@@ -80,8 +80,8 @@ final class T4Address extends Address {
// We don't recognize this address syntax
//
if (acceptsURL(addr) == false) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "unknown_prefix_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", addr);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "unknown_prefix_error", null);
se.setNextException(se2);
throw se;
@@ -157,8 +157,8 @@ final class T4Address extends Address {
*/
private String extractHostFromUrl(String url) throws SQLException {
if (url.length() < minT4ConnectionAddrLen) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "min_address_length_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "min_address_length_error", null);
se.setNextException(se2);
throw se;
@@ -173,8 +173,8 @@ final class T4Address extends Address {
}
if (hostEndIndex < 0) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "address_format_error", url);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_format_error", url);
se.setNextException(se2);
throw se;
@@ -182,9 +182,9 @@ final class T4Address extends Address {
String host = url.substring(hostStartIndex, hostEndIndex);
if ((host == null) || (host.length() == 0)) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "address_format_error", null);
- SQLException se3 = HPT4Messages.createSQLException(m_t4props, m_locale, "missing_ip_or_name_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_format_error", null);
+ SQLException se3 = TrafT4Messages.createSQLException(m_t4props, m_locale, "missing_ip_or_name_error", null);
se.setNextException(se2);
se2.setNextException(se3);
throw se;
@@ -232,8 +232,8 @@ final class T4Address extends Address {
*/
private boolean isIPV6(String url) throws SQLException {
if (url == null) {
- SQLException se = HPT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
- SQLException se2 = HPT4Messages.createSQLException(m_t4props, m_locale, "address_format_2_error", null);
+ SQLException se = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_parsing_error", url);
+ SQLException se2 = TrafT4Messages.createSQLException(m_t4props, m_locale, "address_format_2_error", null);
se.setNextException(se2);
throw se;
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Connection.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Connection.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Connection.java
index d1ce34f..e9ab242 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Connection.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4Connection.java
@@ -118,7 +118,7 @@ class T4Connection {
} catch (SQLException sqex) {
// ignores
}
- throw HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "ids_s1_t00", null);
+ throw TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "ids_s1_t00", null);
}
}
@@ -139,8 +139,8 @@ class T4Connection {
tempP = m_ic.t4props_;
}
- SQLException se = HPT4Messages.createSQLException(tempP, m_locale, "internal_error", null);
- SQLException se2 = HPT4Messages.createSQLException(tempP, m_locale, "contact_hp_error", null);
+ SQLException se = TrafT4Messages.createSQLException(tempP, m_locale, "internal_error", null);
+ SQLException se2 = TrafT4Messages.createSQLException(tempP, m_locale, "contact_traf_error", null);
se.setNextException(se2);
throw se;
@@ -228,19 +228,19 @@ class T4Connection {
} catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "InitializeDialogueMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
}
catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"initialize_dialogue_message_error", e.getMessage());
se.initCause(e);
@@ -303,17 +303,17 @@ class T4Connection {
catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "TerminateDialogMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"terminate_dialogue_message_error", e.getMessage());
se.initCause(e);
@@ -360,17 +360,17 @@ class T4Connection {
catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "SetConnectionOptionReply", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"set_connection_option_message_error", e.getMessage());
se.initCause(e);
@@ -406,17 +406,17 @@ class T4Connection {
catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "EndTransactionMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "end_transaction_message_error",
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "end_transaction_message_error",
e.getMessage());
se.initCause(e);
@@ -483,17 +483,17 @@ class T4Connection {
catch (SQLException se) {
throw se;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"translation_of_parameter_failed", "GetSQLCatalogsMessage", e.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale, "unsupported_encoding", e
.getCharsetName());
se.initCause(e);
throw se;
} catch (Exception e) {
- SQLException se = HPT4Messages.createSQLException(m_ic.t4props_, m_locale,
+ SQLException se = TrafT4Messages.createSQLException(m_ic.t4props_, m_locale,
"get_sql_catalogs_message_error", e.getMessage());
se.initCause(e);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DSProperties.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DSProperties.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DSProperties.java
index a44d0f3..c16ab8e 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DSProperties.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DSProperties.java
@@ -33,8 +33,8 @@ import java.util.logging.Level;
* <p>
* Description: The <code>T4DSProperties</code> class contains all the
* properties associated with Type 4 data source connection.
- * <code>T4DSProperties</code> is inherited by the <code>HPT4DataSource,
- * HPT4ConnectionPooledDataSource</code>
+ * <code>T4DSProperties</code> is inherited by the <code>TrafT4DataSource,
+ * TrafT4ConnectionPooledDataSource</code>
* classes for configuring Type 4 connection properties.
* <p>
* The properties passed to the Type 4 driver have this precedence order in
@@ -157,7 +157,7 @@ public class T4DSProperties extends T4Properties {
* Gets the default catalog that will be used to access SQL objects
* referenced in SQL statements if the SQL objects are not fully qualified.
*
- * @return HPT4 catalog name.
+ * @return TrafT4 catalog name.
* @see #setCatalog(String)
*/
public String getCatalog() {
[7/9] incubator-trafodion git commit: For Trafci which not care about
version
Posted by db...@apache.org.
For Trafci which not care about version
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/f8f1f487
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/f8f1f487
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/f8f1f487
Branch: refs/heads/master
Commit: f8f1f487000e815efb2592899f6e217bdd06e165
Parents: 38e49cf
Author: Kevin Xu <ka...@esgyn.cn>
Authored: Fri May 20 08:30:17 2016 +0800
Committer: Kevin Xu <ka...@esgyn.cn>
Committed: Fri May 20 08:30:17 2016 +0800
----------------------------------------------------------------------
core/conn/jdbcT4/Makefile | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f8f1f487/core/conn/jdbcT4/Makefile
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/Makefile b/core/conn/jdbcT4/Makefile
index 828416c..908a14f 100644
--- a/core/conn/jdbcT4/Makefile
+++ b/core/conn/jdbcT4/Makefile
@@ -31,6 +31,7 @@ build_all: LICENSE NOTICE
cp target/jdbcT4-${TRAFODION_VER}.jar ${MY_SQROOT}/export/lib
mkdir -p ../clients
mv target/jdbcT4-${TRAFODION_VER}.zip ../clients
+ ln -sf ${MY_SQROOT}/export/lib/jdbcT4-${TRAFODION_VER}.jar ${MY_SQROOT}/export/lib/jdbcT4.jar
clean:
-$(MAVEN) clean | grep ERROR
[8/9] incubator-trafodion git commit: Along with jdbcT4 rename changes
Posted by db...@apache.org.
Along with jdbcT4 rename changes
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/283190e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/283190e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/283190e1
Branch: refs/heads/master
Commit: 283190e1c0f404a29de36b8fd04fea2080b5ed7f
Parents: f8f1f48
Author: Kevin Xu <ka...@esgyn.cn>
Authored: Fri May 20 11:01:29 2016 +0800
Committer: Kevin Xu <ka...@esgyn.cn>
Committed: Fri May 20 11:01:29 2016 +0800
----------------------------------------------------------------------
.../java/org/trafodion/dcs/util/JdbcT4Util.java | 24 +++++---------------
1 file changed, 6 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/283190e1/dcs/src/main/java/org/trafodion/dcs/util/JdbcT4Util.java
----------------------------------------------------------------------
diff --git a/dcs/src/main/java/org/trafodion/dcs/util/JdbcT4Util.java b/dcs/src/main/java/org/trafodion/dcs/util/JdbcT4Util.java
index dd28c2c..dfd2895 100644
--- a/dcs/src/main/java/org/trafodion/dcs/util/JdbcT4Util.java
+++ b/dcs/src/main/java/org/trafodion/dcs/util/JdbcT4Util.java
@@ -22,42 +22,30 @@
**********************************************************************/
package org.trafodion.dcs.util;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.*;
-import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.math.BigDecimal;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.GnuParser;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.HelpFormatter;
-import org.codehaus.jettison.json.JSONArray;
-import org.codehaus.jettison.json.JSONException;
-import org.codehaus.jettison.json.JSONObject;
+import org.apache.commons.cli.Options;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
-import org.trafodion.dcs.util.DcsConfiguration;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
import org.trafodion.dcs.Constants;
import org.trafodion.jdbc.t4.TrafT4Connection;
+import org.trafodion.jdbc.t4.TrafT4DataSource;
import org.trafodion.jdbc.t4.TrafT4PreparedStatement;
-import org.trafodion.jdbc.t4.HPT4DataSource;
public final class JdbcT4Util
{
private static final Log LOG = LogFactory.getLog(JdbcT4Util.class);
private Configuration conf;
private DcsNetworkConfiguration netConf;
- private HPT4DataSource cpds = null;
+ private TrafT4DataSource cpds = null;
static {
try {
@@ -72,7 +60,7 @@ public final class JdbcT4Util
public void init(Configuration conf,DcsNetworkConfiguration netConf) throws SQLException {
this.conf = conf;
this.netConf = netConf;
- cpds = new HPT4DataSource();
+ cpds = new TrafT4DataSource();
String url = Constants.T4_DRIVER_URL + "//" + netConf.getHostName() + ":" + conf.getInt(Constants.DCS_MASTER_PORT,Constants.DEFAULT_DCS_MASTER_PORT) + "/:";
cpds.setURL(url);
cpds.setMinPoolSize(conf.getInt(Constants.T4_DRIVER_MIN_POOL_SIZE,Constants.DEFAULT_T4_DRIVER_MIN_POOL_SIZE));
[2/9] incubator-trafodion git commit: Rename required prefix with Traf
Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PreparedStatement.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PreparedStatement.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PreparedStatement.java
index 0d4fe28..15e420b 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PreparedStatement.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PreparedStatement.java
@@ -227,7 +227,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
// * If LOB is involved with autocommit enabled we throw an exception
// *******************************************************************
if (isAnyLob_ && (connection_.getAutoCommit())) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_lob_commit_state", null);
}
if (inputDesc_ != null) {
@@ -271,27 +271,27 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
try {
clearWarnings();
- HPT4Exception se;
+ TrafT4Exception se;
Object[] valueArray = null;
if (inputDesc_ == null) {
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"batch_command_failed", null);
throw new BatchUpdateException(se.getMessage(), se.getSQLState(), new int[0]);
}
if (sqlStmtType_ == TRANSPORT.TYPE_SELECT) {
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"select_in_batch_not_supported", null);
throw new BatchUpdateException(se.getMessage(), se.getSQLState(), new int[0]);
}
if (connection_._isClosed()) {
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_connection",
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_connection",
null);
connection_.closeErroredConnection(se);
throw new BatchUpdateException(se.getMessage(), se.getSQLState(), new int[0]);
}
if (isAnyLob_ && (connection_.getAutoCommit())) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_lob_commit_state", null);
}
@@ -312,7 +312,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (SQLException e) {
BatchUpdateException be;
- se = HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ se = TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"batch_command_failed", null);
if (batchRowCount_ == null) // we failed before execute
{
@@ -355,7 +355,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
validateExecuteInvocation();
if (sqlStmtType_ != TRANSPORT.TYPE_SELECT) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "non_select_invalid",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "non_select_invalid",
null);
}
@@ -401,7 +401,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
validateExecuteInvocation();
// if (sqlStmtType_ == TRANSPORT.TYPE_SELECT)
if (sqlStmtType_ == TRANSPORT.TYPE_SELECT && (ist_.stmtIsLock != true)) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "select_invalid", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "select_invalid", null);
}
if (usingRawRowset_ == false) {
@@ -422,7 +422,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
// * If LOB is involved with autocommit enabled we throw an exception
// *******************************************************************
if (isAnyLob_ && (connection_.getAutoCommit())) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_lob_commit_state", null);
}
@@ -451,7 +451,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
}
if (outputDesc_ != null) {
- return new HPT4ResultSetMetaData(this, outputDesc_);
+ return new TrafT4ResultSetMetaData(this, outputDesc_);
} else {
return null;
}
@@ -473,7 +473,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
connection_.props_.getLogWriter().println(temp);
}
if (inputDesc_ != null) {
- return new HPT4ParameterMetaData(this, inputDesc_);
+ return new TrafT4ParameterMetaData(this, inputDesc_);
} else {
return null;
}
@@ -496,7 +496,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
connection_.props_.getLogWriter().println(temp);
}
validateSetInvocation(parameterIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setArray()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setArray()");
}
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
@@ -539,7 +539,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
@@ -548,12 +548,12 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"unsupported_encoding", messageArguments);
}
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_datatype_for_column", null);
}
}
@@ -620,7 +620,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
case Types.INTEGER:
case Types.SMALLINT:
case Types.TINYINT:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_datatype_for_column", null);
case Types.CHAR:
case Types.VARCHAR:
@@ -638,7 +638,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
addParamValue(parameterIndex, buffer2);
@@ -651,7 +651,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
@@ -695,7 +695,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_datatype_for_column", null);
}
}
@@ -778,7 +778,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
addParamValue(parameterIndex, tmpArray);
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
}
@@ -815,7 +815,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
case Types.INTEGER:
case Types.SMALLINT:
case Types.TINYINT:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_datatype_for_column", null);
default:
@@ -825,7 +825,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
if (valuePos < 1) {
Object[] messageArguments = new Object[1];
messageArguments[0] = "No data to read from the Reader";
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
@@ -838,7 +838,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
addParamValue(parameterIndex, new String(value));
@@ -886,10 +886,10 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
case Types.DOUBLE:
case Types.FLOAT:
case Types.NUMERIC:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_datatype_for_column", null);
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
}
@@ -916,7 +916,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
if (x != null) {
@@ -955,7 +955,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
// Ignore the cal, since SQL would expect it to store it in the local
@@ -1147,7 +1147,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} else if (x instanceof BigInteger) {
setBigDecimal(parameterIndex, new BigDecimal((BigInteger) x));
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"object_type_not_supported", null);
}
}
@@ -1237,7 +1237,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
setDate(parameterIndex, Date.valueOf(x.toString()));
}
} catch (IllegalArgumentException iex) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_parameter_value", x.toString());
}
break;
@@ -1303,7 +1303,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} else if (x instanceof String) {
addParamValue(parameterIndex, x);
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"conversion_not_allowed", null);
}
break;
@@ -1315,7 +1315,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
case Types.JAVA_OBJECT:
case Types.STRUCT:
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"object_type_not_supported", null);
}
}
@@ -1338,7 +1338,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
connection_.props_.getLogWriter().println(temp);
}
validateSetInvocation(i);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setRef()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setRef()");
}
public void setShort(int parameterIndex, short x) throws SQLException {
@@ -1398,7 +1398,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
case Types.DATALINK:
case Types.JAVA_OBJECT:
case Types.REF:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"datatype_not_supported", null);
case Types.BIGINT:
case Types.INTEGER:
@@ -1423,7 +1423,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
setObject(parameterIndex, x, dataType);
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"fetch_output_inconsistent", null);
}
@@ -1451,7 +1451,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
if (x != null) {
@@ -1490,7 +1490,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
// Ignore the cal, since SQL would expect it to store it in the local
@@ -1530,7 +1530,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
if (x != null) {
@@ -1577,7 +1577,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
dataType = inputDesc_[parameterIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
// Ignore the cal, since SQL would expect it to store it in the local
@@ -1634,7 +1634,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
case Types.INTEGER:
case Types.BIGINT:
case Types.TINYINT:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_datatype_for_column", null);
default:
try {
@@ -1642,7 +1642,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
try {
@@ -1651,7 +1651,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"unsupported_encoding", messageArguments);
}
break;
@@ -1675,7 +1675,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
connection_.props_.getLogWriter().println(temp);
}
validateSetInvocation(parameterIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setURL()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "setURL()");
} // end setURL
// -------------------------------------------------------------------------------------------
@@ -1721,7 +1721,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
}
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "stmt_closed", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "stmt_closed", null);
}
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
@@ -1732,7 +1732,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
}
}
if (paramRowCount_ > 0 && usingRawRowset_ == false) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"function_sequence_error", null);
}
@@ -1756,7 +1756,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
Object[] messageArguments = new Object[2];
messageArguments[0] = new Integer(paramNumber + 1);
messageArguments[1] = new Integer(paramRowCount_ + 1);
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "parameter_not_set",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "parameter_not_set",
messageArguments);
}
}
@@ -1768,20 +1768,20 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
connection_.props_.t4Logger_.logp(Level.FINER, "TrafT4PreparedStatement", "validateSetInvocation", "", p);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "stmt_closed", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "stmt_closed", null);
}
// connection_.getServerHandle().isConnectionOpen();
connection_.isConnectionOpen();
if (inputDesc_ == null) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_parameter_index", null);
}
if (parameterIndex < 1 || parameterIndex > inputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_parameter_index", null);
}
if (inputDesc_[parameterIndex - 1].paramMode_ == DatabaseMetaData.procedureColumnOut) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "is_a_output_parameter",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "is_a_output_parameter",
null);
}
}
@@ -1863,7 +1863,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
// ----------------------------------------------------------------------------------
// Method used by JNI Layer to update the results of Prepare
- void setPrepareOutputs(HPT4Desc[] inputDesc, HPT4Desc[] outputDesc, int inputParamCount, int outputParamCount)
+ void setPrepareOutputs(TrafT4Desc[] inputDesc, TrafT4Desc[] outputDesc, int inputParamCount, int outputParamCount)
throws SQLException {
if (connection_.props_.t4Logger_.isLoggable(Level.FINER) == true) {
Object p[] = T4LoggingUtilities.makeParams(connection_.props_, inputDesc, outputDesc, inputParamCount,
@@ -1883,7 +1883,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
} // end setPrepareOutputs
// ----------------------------------------------------------------------------------
- void setPrepareOutputs2(HPT4Desc[] inputDesc, HPT4Desc[] outputDesc, int inputParamCount, int outputParamCount,
+ void setPrepareOutputs2(TrafT4Desc[] inputDesc, TrafT4Desc[] outputDesc, int inputParamCount, int outputParamCount,
int inputParamsLength, int outputParamsLength, int inputDescLength, int outputDescLength)
throws SQLException {
if (connection_.props_.t4Logger_.isLoggable(Level.FINER) == true) {
@@ -1955,7 +1955,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
}
if (resultSetType != ResultSet.TYPE_FORWARD_ONLY && resultSetType != ResultSet.TYPE_SCROLL_INSENSITIVE
&& resultSetType != ResultSet.TYPE_SCROLL_SENSITIVE) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_resultset_type", null);
}
if (resultSetType == ResultSet.TYPE_SCROLL_SENSITIVE) {
@@ -1965,7 +1965,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
resultSetType_ = resultSetType;
}
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY && resultSetConcurrency != ResultSet.CONCUR_UPDATABLE) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_resultset_concurrency", null);
}
resultSetConcurrency_ = resultSetConcurrency;
@@ -2093,10 +2093,10 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
connection_.isConnectionOpen();
sqlStmtType_ = ist_.getSqlStmtType(sql);
if (sqlStmtType_ == TRANSPORT.TYPE_STATS) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"infostats_invalid_error", null);
} else if (sqlStmtType_ == TRANSPORT.TYPE_CONFIG) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"config_cmd_invalid_error", null);
}
ist_.setTransactionStatus(connection_, sql);
@@ -2134,10 +2134,10 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
connection_.isConnectionOpen();
sqlStmtType_ = ist_.getSqlStmtType(sql);
if (sqlStmtType_ == TRANSPORT.TYPE_STATS) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"infostats_invalid_error", null);
} else if (sqlStmtType_ == TRANSPORT.TYPE_CONFIG) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"config_cmd_invalid_error", null);
}
ist_.setTransactionStatus(connection_, sql);
@@ -2230,7 +2230,7 @@ public class TrafT4PreparedStatement extends TrafT4Statement implements java.sql
}
if (rows < 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_fetchSize_value", null);
}
if (rows > 0) {
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSet.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSet.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSet.java
index b08d539..cfbea75 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSet.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSet.java
@@ -60,7 +60,7 @@ import java.util.logging.LogRecord;
// This class partially implements the result set class as defined in
// java.sql.ResultSet.
// ----------------------------------------------------------------------------
-public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
+public class TrafT4ResultSet extends TrafT4Handle implements java.sql.ResultSet {
// java.sql.ResultSet interface methods
public boolean absolute(int row) throws SQLException {
@@ -83,15 +83,15 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
null);
}
if (row == 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_row_number",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_row_number",
null);
}
@@ -144,11 +144,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
null);
}
last();
@@ -174,11 +174,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
null);
}
@@ -191,7 +191,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public void cancelRowUpdates() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"cancelRowUpdates - not supported", null);
}
@@ -235,7 +235,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public void deleteRow() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"deleteRow - not supported",
null);
@@ -259,7 +259,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
int i;
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
for (i = 0; i < outputDesc_.length; i++) {
@@ -267,7 +267,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
return i + 1;
}
}
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_name", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_name", null);
}
public boolean first() throws SQLException {
@@ -289,11 +289,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
null);
}
@@ -327,7 +327,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
validateGetInvocation(columnIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getArray()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getArray()");
return null;
}
@@ -390,14 +390,14 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"unsupported_encoding", messageArguments);
}
} else {
return null;
}
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
@@ -457,7 +457,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
d = new Double(data);
} catch (NumberFormatException e1) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
retValue = new BigDecimal(d.doubleValue());
@@ -572,7 +572,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
return null;
}
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
}
@@ -628,7 +628,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
shortValue = getShort(columnIndex);
} catch (NumberFormatException e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
switch (shortValue) {
@@ -637,7 +637,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
case 1:
return true;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"numeric_out_of_range", null);
}
}
@@ -695,7 +695,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
d = new Double(data);
} catch (NumberFormatException e1) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
d1 = d.doubleValue();
@@ -706,7 +706,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
setSQLWarning(null, "data_truncation", null);
}
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"numeric_out_of_range", null);
}
}
@@ -777,14 +777,14 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
} else if (x instanceof String) {
return ((String) x).getBytes();
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
}
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
}
@@ -847,7 +847,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
return null;
}
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
@@ -888,7 +888,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (stmt_ != null) {
@@ -915,7 +915,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (spj_rs_ && stmtLabel_ != null) {
@@ -968,7 +968,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
dataType = outputDesc_[columnIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
@@ -998,7 +998,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
setSQLWarning(null, "data_truncation", null);
} catch (IllegalArgumentException ex) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
}
@@ -1142,7 +1142,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
return Double.parseDouble(data);
} catch (NumberFormatException e1) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
} else {
@@ -1185,7 +1185,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
return fetchDirection_;
@@ -1207,7 +1207,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
return fetchSize_;
@@ -1238,7 +1238,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
if (data >= Float.NEGATIVE_INFINITY && data <= Float.POSITIVE_INFINITY) {
return (float) data;
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "numeric_out_of_range",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "numeric_out_of_range",
null);
}
}
@@ -1291,7 +1291,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
d = new Double(data).doubleValue();
} catch (NumberFormatException e1) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
@@ -1301,7 +1301,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
setSQLWarning(null, "data_truncation", null);
}
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"numeric_out_of_range", null);
}
}
@@ -1370,7 +1370,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
setSQLWarning(null, "data_truncation", null);
}
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"numeric_out_of_range", null);
}
} catch (NumberFormatException e2) {
@@ -1378,7 +1378,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
d = new Double(data).doubleValue();
} catch (NumberFormatException e1) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
@@ -1389,7 +1389,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
setSQLWarning(null, "data_truncation", null);
}
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"numeric_out_of_range", null);
}
}
@@ -1436,10 +1436,10 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
- return new HPT4ResultSetMetaData(this, outputDesc_);
+ return new TrafT4ResultSetMetaData(this, outputDesc_);
}
public Object getObject(int columnIndex) throws SQLException {
@@ -1550,7 +1550,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
case Types.OTHER:
return getString(columnIndex);
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
}
@@ -1572,7 +1572,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
validateGetInvocation(columnIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getObject()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getObject()");
return null;
}
@@ -1632,7 +1632,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
validateGetInvocation(columnIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getRef()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getRef()");
return null;
}
@@ -1673,7 +1673,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (isBeforeFirst_ || isAfterLast_ || onInsertRow_) {
@@ -1717,7 +1717,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
d = new Double(data).doubleValue();
} catch (NumberFormatException e1) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
@@ -1729,7 +1729,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
setSQLWarning(null, "data_truncation", null);
}
} else {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"numeric_out_of_range", null);
}
}
@@ -1776,7 +1776,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
return stmt_;
@@ -1899,7 +1899,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
try {
data = new String((byte[]) x, "ASCII");
} catch (Exception e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"unsupported_encoding", "ASCII");
}
} else {
@@ -1927,38 +1927,38 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
break;
case InterfaceResultSet.SQLTYPECODE_DATETIME: {
switch (outputDesc_[columnIndex - 1].sqlDatetimeCode_) {
- case HPT4Desc.SQLDTCODE_YEAR:
- case HPT4Desc.SQLDTCODE_YEAR_TO_MONTH:
- case HPT4Desc.SQLDTCODE_MONTH:
- case HPT4Desc.SQLDTCODE_MONTH_TO_DAY:
- case HPT4Desc.SQLDTCODE_DAY:
- case HPT4Desc.SQLDTCODE_HOUR:
- case HPT4Desc.SQLDTCODE_HOUR_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_MINUTE:
- case HPT4Desc.SQLDTCODE_MINUTE_TO_SECOND:
- // case HPT4Desc.SQLDTCODE_MINUTE_TO_FRACTION:
- case HPT4Desc.SQLDTCODE_SECOND:
- // case HPT4Desc.SQLDTCODE_SECOND_TO_FRACTION:
- case HPT4Desc.SQLDTCODE_YEAR_TO_HOUR:
- case HPT4Desc.SQLDTCODE_YEAR_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_MONTH_TO_HOUR:
- case HPT4Desc.SQLDTCODE_MONTH_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_MONTH_TO_SECOND:
- // case HPT4Desc.SQLDTCODE_MONTH_TO_FRACTION:
- case HPT4Desc.SQLDTCODE_DAY_TO_HOUR:
- case HPT4Desc.SQLDTCODE_DAY_TO_MINUTE:
- case HPT4Desc.SQLDTCODE_DAY_TO_SECOND:
- // case HPT4Desc.SQLDTCODE_DAY_TO_FRACTION:
- case HPT4Desc.SQLDTCODE_HOUR_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_YEAR:
+ case TrafT4Desc.SQLDTCODE_YEAR_TO_MONTH:
+ case TrafT4Desc.SQLDTCODE_MONTH:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_DAY:
+ case TrafT4Desc.SQLDTCODE_DAY:
+ case TrafT4Desc.SQLDTCODE_HOUR:
+ case TrafT4Desc.SQLDTCODE_HOUR_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MINUTE_TO_SECOND:
+ // case TrafT4Desc.SQLDTCODE_MINUTE_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_SECOND:
+ // case TrafT4Desc.SQLDTCODE_SECOND_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_YEAR_TO_HOUR:
+ case TrafT4Desc.SQLDTCODE_YEAR_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_HOUR:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_MONTH_TO_SECOND:
+ // case TrafT4Desc.SQLDTCODE_MONTH_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_DAY_TO_HOUR:
+ case TrafT4Desc.SQLDTCODE_DAY_TO_MINUTE:
+ case TrafT4Desc.SQLDTCODE_DAY_TO_SECOND:
+ // case TrafT4Desc.SQLDTCODE_DAY_TO_FRACTION:
+ case TrafT4Desc.SQLDTCODE_HOUR_TO_FRACTION:
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"object_type_not_supported", null);
}
}
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"object_type_not_supported", null);
}
}
@@ -1971,7 +1971,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
case Types.JAVA_OBJECT:
case Types.STRUCT:
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"object_type_not_supported", null);
}
return data;
@@ -2020,7 +2020,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
dataType = outputDesc_[columnIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
data = getLocalString(columnIndex);
@@ -2031,7 +2031,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
timestamp = Timestamp.valueOf(data);
retValue = new Time(timestamp.getTime());
} catch (IllegalArgumentException e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
break;
@@ -2049,13 +2049,13 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
timestamp = Timestamp.valueOf(data);
retValue = new Time(timestamp.getTime());
} catch (IllegalArgumentException ex) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
}
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"restricted_data_type", null);
}
return retValue;
@@ -2158,7 +2158,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
dataType = outputDesc_[columnIndex - 1].dataType_;
if (dataType != Types.CHAR && dataType != Types.VARCHAR && dataType != Types.LONGVARCHAR
&& dataType != Types.DATE && dataType != Types.TIME && dataType != Types.TIMESTAMP) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "restricted_data_type",
null);
}
data = getLocalString(columnIndex);
@@ -2169,7 +2169,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
dateValue = Date.valueOf(data);
retValue = new Timestamp(dateValue.getTime());
} catch (IllegalArgumentException e) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
break;
@@ -2200,7 +2200,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
retValue = new Timestamp(timeValue.getTime());
retValue.setNanos(nano);
} catch (IllegalArgumentException e2) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_cast_specification", null);
}
@@ -2208,7 +2208,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"restricted_data_type", null);
}
return retValue;
@@ -2305,7 +2305,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (stmt_ != null) {
@@ -2342,7 +2342,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"unsupported_encoding", messageArguments);
}
} else {
@@ -2386,7 +2386,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
validateGetInvocation(columnIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getURL()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getURL()");
return null;
}
@@ -2410,12 +2410,12 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
public byte[] getRawBytes(int columnIndex) throws SQLException {
- HPT4Desc desc;
+ TrafT4Desc desc;
byte[] ret;
if (!keepRawBuffer_) // if you dont set the property, we will not
// support the call
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getRawBytes()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "getRawBytes()");
validateGetInvocation(columnIndex); // verify columnIndex and that we
// are not closed
@@ -2471,7 +2471,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// ------------------------------------------------------------------
// Method not implemented
public void insertRow() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"insertRow - not supported",
null);
@@ -2493,7 +2493,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
return isAfterLast_;
@@ -2515,7 +2515,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
return isBeforeFirst_;
@@ -2537,7 +2537,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if ((getType() == ResultSet.TYPE_FORWARD_ONLY) && (getConcurrency() == ResultSet.CONCUR_UPDATABLE)) {
@@ -2571,7 +2571,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
/*
@@ -2612,11 +2612,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
null);
}
@@ -2656,7 +2656,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (!onInsertRow_) {
@@ -2673,7 +2673,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public void moveToInsertRow() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"moveToInsertRow - not supported",
null);
@@ -2703,7 +2703,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
@@ -2783,11 +2783,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
boolean validRow = false;
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
null);
}
@@ -2809,7 +2809,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public void refreshRow() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"refreshRow - not supported",
null);
@@ -2836,11 +2836,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
clearWarnings();
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "forward_only_cursor",
null);
}
@@ -2871,7 +2871,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public boolean rowDeleted() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"rowDeleted - not supported",
null);
@@ -2879,7 +2879,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public boolean rowInserted() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"rowInserted - not supported",
null);
@@ -2887,7 +2887,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public boolean rowUpdated() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"rowUpdated - not supported",
null);
@@ -2909,7 +2909,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
switch (direction) {
@@ -2921,7 +2921,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
fetchDirection_ = ResultSet.FETCH_FORWARD;
break;
default:
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"invalid_fetch_direction", null);
}
}
@@ -2942,11 +2942,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (rows < 0) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_fetch_size",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_fetch_size",
null);
} else if (rows == 0) {
fetchSize_ = DEFAULT_FETCH_SIZE;
@@ -2971,7 +2971,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
validateUpdInvocation(columnIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "updateArray()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "updateArray()");
}
public void updateArray(String columnName, Array x) throws SQLException {
@@ -3022,7 +3022,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
try {
@@ -3030,7 +3030,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
} catch (java.io.UnsupportedEncodingException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "unsupported_encoding",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "unsupported_encoding",
messageArguments);
}
}
@@ -3121,7 +3121,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
getCurrentRow().updateArrayElement(columnIndex, value);
@@ -3283,7 +3283,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
if (valuePos < 1) {
Object[] messageArguments = new Object[1];
messageArguments[0] = "No data to read from the Reader";
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
@@ -3298,7 +3298,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
} catch (java.io.IOException e) {
Object[] messageArguments = new Object[1];
messageArguments[0] = e.getMessage();
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "io_exception",
messageArguments);
}
getCurrentRow().updateArrayElement(columnIndex, new String(value));
@@ -3642,7 +3642,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
validateUpdInvocation(columnIndex);
- HPT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "updateRef()");
+ TrafT4Messages.throwUnsupportedFeatureException(connection_.props_, connection_.getLocale(), "updateRef()");
}
public void updateRef(String columnName, Ref x) throws SQLException {
@@ -3666,7 +3666,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Method not implemented
public void updateRow() throws SQLException {
- throw HPT4Messages.createSQLException(connection_.props_,
+ throw TrafT4Messages.createSQLException(connection_.props_,
connection_.getLocale(),
"updateRow - not supported", null);
}
@@ -3839,7 +3839,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
return wasNull_;
@@ -3861,7 +3861,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (columnIndex < 1 || columnIndex > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
}
outputDesc_[columnIndex - 1].name_ = columnName;
@@ -3919,7 +3919,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
int i;
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
for (i = 0; i < outputDesc_.length; i++) {
@@ -3927,7 +3927,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
return i + 1;
}
}
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_name", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_name", null);
}
private void validateGetInvocation(int columnIndex) throws SQLException {
@@ -3946,11 +3946,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (isClosed_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_cursor_state",
null);
}
if (columnIndex < 1 || columnIndex > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
}
}
@@ -3976,7 +3976,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
}
int i;
if (getConcurrency() == ResultSet.CONCUR_READ_ONLY) {
- throw HPT4Messages
+ throw TrafT4Messages
.createSQLException(connection_.props_, connection_.getLocale(), "read_only_concur", null);
}
for (i = 0; i < outputDesc_.length; i++) {
@@ -3984,7 +3984,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
return i + 1;
}
}
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_name", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_name", null);
}
private void validateUpdInvocation(int columnIndex) throws SQLException {
@@ -4003,11 +4003,11 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (getConcurrency() == ResultSet.CONCUR_READ_ONLY) {
- throw HPT4Messages
+ throw TrafT4Messages
.createSQLException(connection_.props_, connection_.getLocale(), "read_only_concur", null);
}
if (columnIndex < 1 || columnIndex > outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
}
}
@@ -4031,10 +4031,10 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
return insertRow_;
} else {
if (isBeforeFirst_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "cursor_is_before_first_row", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "cursor_is_before_first_row", null);
}
if (isAfterLast_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "cursor_after_last_row", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "cursor_after_last_row", null);
}
return (ObjectArray) cachedRows_.get(currentRow_ - 1);
}
@@ -4078,7 +4078,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
String columnName;
if (noKeyFound_) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "no_primary_key", null);
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "no_primary_key", null);
}
try {
@@ -4111,7 +4111,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
if (rowCount == 0) {
noKeyFound_ = true;
stmt_.resultSetConcurrency_ = ResultSet.CONCUR_READ_ONLY;
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"no_primary_key", null);
}
@@ -4141,7 +4141,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
if (colNo > columnCount) {
noKeyFound_ = true;
stmt_.resultSetConcurrency_ = ResultSet.CONCUR_READ_ONLY;
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(),
"no_primary_key", null);
}
}
@@ -4376,7 +4376,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (ColumnCount >= outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
} else {
return outputDesc_[ColumnCount].fsDataType_;
@@ -4399,7 +4399,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (ColumnCount >= outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
} else {
return outputDesc_[ColumnCount].sqlDataType_;
@@ -4422,7 +4422,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (ColumnCount >= outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
} else {
return outputDesc_[ColumnCount].precision_;
@@ -4445,7 +4445,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (ColumnCount >= outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
} else {
return outputDesc_[ColumnCount].scale_;
@@ -4468,7 +4468,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (ColumnCount >= outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
} else {
return outputDesc_[ColumnCount].sqlDatetimeCode_;
@@ -4495,7 +4495,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (ColumnCount >= outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
} else {
return outputDesc_[ColumnCount].sqlOctetLength_;
@@ -4518,7 +4518,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
connection_.props_.getLogWriter().println(temp);
}
if (ColumnCount >= outputDesc_.length) {
- throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
+ throw TrafT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "invalid_column_index",
null);
} else {
return outputDesc_[ColumnCount].isSigned_;
@@ -4560,18 +4560,18 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
wasNull_ = false;
} catch (CharacterCodingException e) {
- SQLException se = HPT4Messages.createSQLException(this.connection_.ic_.t4props_,
+ SQLException se = TrafT4Messages.createSQLException(this.connection_.ic_.t4props_,
this.connection_.getLocale(), "translation_of_parameter_failed", "getLocalString", e
.getMessage());
se.initCause(e);
throw se;
} catch (UnsupportedCharsetException e) {
- SQLException se = HPT4Messages.createSQLException(this.connection_.ic_.t4props_,
+ SQLException se = TrafT4Messages.createSQLException(this.connection_.ic_.t4props_,
this.connection_.getLocale(), "unsupported_encoding", e.getCharsetName());
se.initCause(e);
throw se;
} catch (UnsupportedEncodingException e) {
- SQLException se = HPT4Messages.createSQLException(this.connection_.ic_.t4props_,
+ SQLException se = TrafT4Messages.createSQLException(this.connection_.ic_.t4props_,
this.connection_.getLocale(), "unsupported_encoding", e.getMessage());
se.initCause(e);
throw se;
@@ -4613,17 +4613,17 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
return useOldDateFormat_;
}
- void closeErroredConnection(HPT4Exception sme) {
+ void closeErroredConnection(TrafT4Exception sme) {
connection_.closeErroredConnection(sme);
}
// Constructors - used in TrafT4Statement
- TrafT4ResultSet(TrafT4Statement stmt, HPT4Desc[] outputDesc) throws SQLException {
+ TrafT4ResultSet(TrafT4Statement stmt, TrafT4Desc[] outputDesc) throws SQLException {
this(stmt, outputDesc, stmt.stmtLabel_, false);
}
// Constructors - used for SPJ ResultSets
- TrafT4ResultSet(TrafT4Statement stmt, HPT4Desc[] outputDesc, String stmt_label, boolean spj_result_set)
+ TrafT4ResultSet(TrafT4Statement stmt, TrafT4Desc[] outputDesc, String stmt_label, boolean spj_result_set)
throws SQLException {
if (stmt.connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
Object p[] = T4LoggingUtilities.makeParams(stmt.connection_.props_, stmt, outputDesc, stmt_label,
@@ -4672,7 +4672,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Constructor - used in T4DatabaseMetaData
// ResultSet is not created on Java side in
// T4DatanaseMetaData due to threading issues
- TrafT4ResultSet(T4DatabaseMetaData dbMetaData, HPT4Desc[] outputDesc, String stmtLabel, boolean oldDateFormat)
+ TrafT4ResultSet(T4DatabaseMetaData dbMetaData, TrafT4Desc[] outputDesc, String stmtLabel, boolean oldDateFormat)
throws SQLException {
if (dbMetaData.connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
Object p[] = T4LoggingUtilities.makeParams(dbMetaData.connection_.props_, dbMetaData, outputDesc, 0,
@@ -4726,7 +4726,7 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
// Fields
InterfaceResultSet irs_;
- HPT4Desc[] outputDesc_;
+ TrafT4Desc[] outputDesc_;
TrafT4Statement stmt_;
TrafT4Connection connection_;
boolean isClosed_;
[3/9] incubator-trafodion git commit: Rename required prefix with Traf
Posted by db...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSource.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSource.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSource.java
new file mode 100644
index 0000000..3ec9e93
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSource.java
@@ -0,0 +1,366 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.Properties;
+import java.util.logging.FileHandler;
+import java.util.logging.Formatter;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+
+/**
+ *
+ * <p>
+ * JDBC Type 4 Driver <code>DataSource</code> class.
+ * </p>
+ * <p>
+ * Description: A <code>DataSource</code> object is a factory for Connection
+ * objects. An object that implements the <code>DataSource</code> interface is
+ * typically registered with a JNDI service provider. A JDBC driver that is
+ * accessed through the <code>DataSource</code> API does not automatically
+ * register itself with the <code>DriverManager</code> object.
+ * </p>
+ *
+ * <p>
+ * The <code>TrafT4DataSource</code> class can provide connection pooling and
+ * statement pooling features.
+ * </p>
+ *
+ * <pre>
+ * <b>Setting properties for the TrafT4DataSource in the Type 4 driver</b>
+ * TrafT4DataSource ds = new TrafT4DataSource();
+ * ds.setUrl("jdbc:t4jdbc://<NDCS host>:<NDCS port>/:");
+ * ds.setCatalog("your catalog");
+ * ds.setSchema("your schema");
+ * ds.setUser("safeguard user name");
+ * ds.setPassword("safeguard password");
+ *
+ * // Following are optional properties
+ * ds.setConnectionTimeout("timeout in seconds");
+ * ds.setT4LogFile("your log file location");
+ * ds.setT4LogLevel("SEVERE");
+ * ds.setServerDataSource("NDCS datasource name");
+ *
+ * // Properties relevant for Type 4 connection pooling.
+ * // Set ds.setMaxPoolSize(-1) to turn OFF connection pooling
+ * ds.setMaxPoolSize("number of connections required");
+ * ds.setMinPoolSize("number of connections required");
+ *
+ * // Properties relevant for Type 4 statement pooling.
+ * // Set ds.setMaxStatement(0) to turn statement pooling OFF
+ * // Statement pooling is enabled only when connection pooling is enabled.
+ * ds.setMaxStatements("number of statements to be pooled");
+ * </pre>
+ *
+ * <pre>
+ * <b>Programmatically registering TrafT4DataSource with JDNI</b>
+ * java.util.Hashtable env = new java.util.Hashtable();
+ * env.put(Context.INITIAL_CONTEXT_FACTORY, "Factory class name here");
+ * javax.naming.Context ctx = new javax.naming.InitialContext(env);
+ * ctx.rebind("DataSource name here", ds);
+ * </pre>
+ *
+ * <pre>
+ * <b>Application making Type4 connection using the DataSource from JDNI</b>
+ * java.util.Hashtable env = new java.util.Hashtable();
+ * env.put(Context.INITIAL_CONTEXT_FACTORY, "Factory class name here");
+ * javax.naming.Context ctx = new javax.naming.InitialContext(env);
+ * DataSource ds = (DataSource)ctx.lookup("DataSource name here");
+ * java.sql.Connection con = ds.getConnection();
+ * </pre>
+ *
+ * <p>
+ * Copyright: (C) Apache Software Foundation (ASF)
+ * </p>
+ *
+ * @see T4Properties
+ */
+public class TrafT4DataSource extends T4DSProperties implements javax.sql.DataSource, java.io.Serializable, Referenceable
+
+{
+ /**
+ * Attempts to establish an NDCS connection.
+ *
+ * @return a connection to the NDCS server.
+ * @throws SQLException
+ * if a database access error or NDCS error occurs.
+ * @see #getConnection(String, String)
+ */
+ synchronized public Connection getConnection() throws SQLException {
+ if (logger.isLoggable(Level.FINER)) {
+ logger.entering("TrafT4DataSource", "getConnection");
+ }
+
+ Connection conn;
+ TrafT4Connection t4Conn;
+ TrafT4ConnectionPoolDataSource pds;
+
+ if (getSQLException() != null) {
+ throw TrafT4Messages.createSQLException(null, getLocale(), "invalid_property", getSQLException());
+ }
+
+ if (getMaxPoolSize() == -1) {
+ t4Conn = new TrafT4Connection(this, getT4Properties());
+ } else {
+ if (poolManager != null) {
+ t4Conn = (TrafT4Connection) poolManager.getConnection();
+ } else {
+
+ pds = new TrafT4ConnectionPoolDataSource(getProperties());
+ poolManager = new TrafT4PooledConnectionManager(pds, getT4LogLevel());
+ t4Conn = (TrafT4Connection) poolManager.getConnection();
+ }
+ }
+
+ t4Conn.setLogInfo(getT4LogLevel(), getLogWriter());
+ conn = t4Conn;
+
+ if (logger.isLoggable(Level.FINER)) {
+ logger.exiting("TrafT4DataSource", "getConnection", conn);
+ }
+
+ return conn;
+ }
+
+ /**
+ * Attempts to establish an NDCS connection.
+ *
+ * @return a connection to the NDCS server.
+ * @param username
+ * Safeguard user name
+ * @param password
+ * Safeguard user password
+ * @throws SQLException
+ * if a database access error or NDCS error occurs.
+ * @see #getConnection()
+ */
+ synchronized public Connection getConnection(String username, String password) throws SQLException {
+ if (logger.isLoggable(Level.FINER)) {
+ logger.entering("TrafT4DataSource", "getConnection", new Object[] { this, username });
+ }
+
+ Connection conn;
+
+ setUser(username);
+ setPassword(password);
+
+ conn = getConnection();
+
+ if (logger.isLoggable(Level.FINER)) {
+ logger.exiting("TrafT4DataSource", "getConnection", conn);
+ }
+
+ return conn;
+ }
+
+ /**
+ * @return Reference Object containing all the Type 4 property references.
+ * @throws NamingException
+ */
+ public Reference getReference() throws NamingException {
+
+ Reference ref = new Reference(this.getClass().getName(), "org.trafodion.jdbc.t4.TrafT4DataSourceFactory", null);
+ return addReferences(ref);
+ }
+
+ /**
+ * Sets the print writer for the current Type 4 data source.
+ *
+ * @param out
+ * java.io.PrintWriter for the current T4 connection.
+ * @throws SQLException
+ * when error occurs.
+ * @see #getLogWriter()
+ * @see javax.sql.ConnectionPoolDataSource
+ */
+ public void setLogWriter(PrintWriter out) throws SQLException {
+ super.setLogWriter(out);
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null, out);
+ t4Logger_.logp(Level.FINE, "TrafT4DataSource", "setLogWriter",
+ "Note, this constructor was called before the previous constructor", p);
+ }
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null, out);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4DataSource");
+ lr.setSourceMethodName("setLogWriter");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ if (poolManager != null) {
+ poolManager.setLogWriter(getLogWriter());
+ }
+ }
+
+ // Local methods
+ void setPoolManager(Context nameCtx, String dataSourceName) throws Exception {
+ if (t4Logger_.isLoggable(Level.FINER) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null, nameCtx, dataSourceName);
+ t4Logger_.logp(Level.FINER, "TrafT4DataSource", "setPoolManager", "", p);
+ }
+ Object pds;
+
+ try {
+ pds = nameCtx.lookup(dataSourceName);
+ if (pds instanceof TrafT4ConnectionPoolDataSource) {
+ poolManager = new TrafT4PooledConnectionManager((TrafT4ConnectionPoolDataSource) pds, getT4LogLevel());
+ }
+ } catch (javax.naming.NameNotFoundException nnfe) {
+ }
+ }
+
+ // --------------------------------------------------------
+ void setupLogFileHandler() {
+ try {
+ if (getT4LogFile() == null) {
+ setT4LogFile(getT4GlobalLogFile());
+ setT4LogFileHandler(getT4GlobalLogFileHandler());
+ } else {
+ if (getT4LogFileHandler() == null) {
+ String temp = getT4LogFile();
+ FileHandler fh1 = new FileHandler(temp);
+
+ Formatter ff1 = new T4LogFormatter();
+
+ fh1.setFormatter(ff1);
+ setT4LogFileHandler(fh1);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } // end setupLogFileHandler
+
+ // --------------------------------------------------------
+
+ /**
+ * Contructor for the <code>TrafT4DataSource</code> object.
+ *
+ * @see #TrafT4DataSource(java.util.Properties)
+ */
+ public TrafT4DataSource() {
+ super();
+ if (getT4LogLevel() != Level.OFF) {
+ setupLogFileHandler();
+ }
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ t4Logger_.logp(Level.FINE, "TrafT4DataSource", "<init>",
+ "Note, this constructor was called before the previous constructor", p);
+ }
+ try {
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4DataSource");
+ lr.setSourceMethodName("<init>");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+
+ }
+
+ /**
+ * Contructor for the <code>TrafT4DataSource</code> object.
+ *
+ * @param info
+ * Contains all the Type 4 properties in a <code>name,
+ * value</code>
+ * pair.
+ * @see #TrafT4DataSource()
+ * @see java.util.Properties
+ */
+ public TrafT4DataSource(Properties info) {
+ super(info);
+ if (getT4LogLevel() != Level.OFF) {
+ setupLogFileHandler();
+ }
+ if (t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ t4Logger_.logp(Level.FINE, "TrafT4DataSource", "<init>",
+ "Note, this constructor was called before the previous constructor", p);
+ }
+ try {
+ if (getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4DataSource");
+ lr.setSourceMethodName("<init>");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ }
+
+ /**
+ * @deprecated
+ */
+ public void setNameType(String nameType) {
+ }
+
+ /**
+ * @deprecated
+ */
+ public String getNameType() {
+ return null;
+ }
+
+ // fields
+ TrafT4PooledConnectionManager poolManager;
+
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object unwrap(Class iface) throws SQLException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isWrapperFor(Class iface) throws SQLException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSourceFactory.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSourceFactory.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSourceFactory.java
new file mode 100644
index 0000000..a1b3408
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4DataSourceFactory.java
@@ -0,0 +1,62 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+
+public class TrafT4DataSourceFactory implements javax.naming.spi.ObjectFactory {
+ public TrafT4DataSourceFactory() {
+ }
+
+ public Object getObjectInstance(Object refobj, Name name, Context nameCtx, Hashtable env) throws Exception {
+ Reference ref = (Reference) refobj;
+ TrafT4DataSource ds;
+ String dataSourceName = null;
+
+ if (ref.getClassName().equals("org.trafodion.jdbc.t4.TrafT4DataSource")) {
+ Properties props = new Properties();
+ for (Enumeration enum2 = ref.getAll(); enum2.hasMoreElements();) {
+ RefAddr tRefAddr = (RefAddr) enum2.nextElement();
+ String type = tRefAddr.getType();
+ String content = (String) tRefAddr.getContent();
+ props.setProperty(type, content);
+ }
+
+ ds = new TrafT4DataSource(props);
+ dataSourceName = ds.getDataSourceName();
+
+ if (dataSourceName != null) {
+ ds.setPoolManager(nameCtx, dataSourceName);
+ }
+ return ds;
+ } else {
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Desc.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Desc.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Desc.java
new file mode 100644
index 0000000..65ce6ea
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Desc.java
@@ -0,0 +1,542 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.Locale;
+
+class TrafT4Desc {
+
+ String getColumnClassName() throws SQLException {
+ switch (dataType_) {
+ case Types.SMALLINT:
+ return "java.lang.Integer";
+ case Types.INTEGER:
+ return "java.lang.Integer";
+ case Types.BIGINT:
+ return "java.lang.Long";
+ case Types.REAL:
+ return "java.lang.Float";
+ case Types.FLOAT:
+ case Types.DOUBLE:
+ return "java.lang.Double";
+ case Types.NUMERIC:
+ case Types.DECIMAL:
+ return "java.math.BigDecimal";
+ case Types.CHAR:
+ case Types.VARCHAR:
+ case Types.LONGVARCHAR:
+ return "java.lang.String";
+ case Types.DATE:
+ return "java.sql.Date";
+ case Types.TIME:
+ return "java.sql.Time";
+ case Types.TIMESTAMP:
+ return "java.sql.Timestamp";
+ case Types.OTHER:
+ return "java.sql.String";
+ case Types.CLOB:
+ return "java.sql.Clob";
+ case Types.BLOB:
+ return "java.sql.Blob";
+ case Types.BIT:
+ case Types.TINYINT:
+ default:
+ return null;
+ }
+ } // end getColumnClassName
+
+ // ---------------------------------------------------------------
+ String getColumnTypeName(Locale locale) throws SQLException {
+ switch (dataType_) {
+ case Types.SMALLINT:
+ return "SMALLINT";
+ case Types.INTEGER:
+ return "INTEGER";
+ case Types.BIGINT:
+ return "BIGINT";
+ case Types.REAL:
+ return "REAL";
+ case Types.FLOAT:
+ return "FLOAT";
+ case Types.DOUBLE:
+ return "DOUBLE PRECISION";
+ case Types.NUMERIC:
+ return "NUMERIC";
+ case Types.DECIMAL:
+ return "DECIMAL";
+ case Types.CHAR:
+ return "CHAR";
+ case Types.VARCHAR:
+ return "VARCHAR";
+ case Types.LONGVARCHAR:
+ return "LONG VARCHAR";
+ case Types.DATE:
+ return "DATE";
+ case Types.TIME:
+ return "TIME";
+ case Types.TIMESTAMP:
+ return "TIMESTAMP";
+ case Types.BLOB:
+ return "BLOB";
+ case Types.CLOB:
+ return "CLOB";
+ case Types.OTHER:
+ if (sqlDataType_ == SQLTYPECODE_INTERVAL) {
+ return "INTERVAL";
+ } else {
+ return "UNKNOWN";
+ }
+ case Types.BIT:
+ case Types.TINYINT:
+ default:
+ return null;
+ }
+ } // end getColumnTypeName
+
+ // ---------------------------------------------------------------
+ void checkValidNumericConversion(Locale locale) throws SQLException {
+ switch (dataType_) {
+ case Types.TINYINT:
+ case Types.SMALLINT:
+ case Types.INTEGER:
+ case Types.BIGINT:
+ case Types.REAL:
+ case Types.FLOAT:
+ case Types.DOUBLE:
+ case Types.NUMERIC:
+ case Types.DECIMAL:
+ case Types.BIT:
+ case Types.CHAR:
+ case Types.VARCHAR:
+ case Types.LONGVARCHAR:
+ case Types.CLOB:
+ case Types.BLOB:
+ break;
+ default:
+ System.out.println("Data type is " + dataType_);
+ throw TrafT4Messages.createSQLException(null, locale, "restricted_data_type", null);
+ }
+ return;
+ } // end checkValidNumericConversion
+
+ // ---------------------------------------------------------------
+ // Constructors
+ TrafT4Desc(int dataType, short datetimeCode, int maxLen, short precision, short scale, boolean nullInfo,
+ String colName, boolean signType, int odbcDataType, short odbcPrecision, int sqlCharset, int odbcCharset,
+ String catalogName, String schemaName, String tableName, int fsDataType, int intLeadPrec, int paramMode) {
+ catalogName_ = catalogName;
+ schemaName_ = schemaName;
+ tableName_ = tableName;
+ name_ = colName;
+ if (nullInfo) {
+ isNullable_ = ResultSetMetaData.columnNullable;
+ } else {
+ isNullable_ = ResultSetMetaData.columnNoNulls;
+
+ }
+
+ sqlDataType_ = dataType;
+ dataType_ = odbcDataType;
+ sqlDatetimeCode_ = datetimeCode;
+ sqlCharset_ = sqlCharset;
+ odbcCharset_ = odbcCharset;
+ isSigned_ = signType;
+ sqlOctetLength_ = maxLen;
+ scale_ = scale;
+ sqlPrecision_ = precision;
+
+ //
+ // Convert ODBC type to equivalent JDBC type when necessary.
+ //
+ // From SqlUcode.h
+ //
+ // #define SQL_WCHAR (-8)
+ // #define SQL_WVARCHAR (-9)
+ // #define SQL_WLONGVARCHAR (-10)
+ //
+ if (odbcDataType == -8) {
+
+ // ODBC's SQL_WCHAR becomes a Types.CHAR
+ dataType_ = Types.CHAR;
+ } else if (odbcDataType == -9) {
+
+ // ODBC's SQL_WVARCHAR becomes a Types.VARCHAR
+ dataType_ = Types.VARCHAR;
+ } else if (odbcDataType == -10) {
+
+ // ODBC's SQL_WLONGVARCHAR becomes a Types.LONGVARCHAR
+ dataType_ = Types.LONGVARCHAR;
+
+ }
+ if (sqlDataType_ == InterfaceResultSet.SQLTYPECODE_DATETIME) // 9
+ {
+ switch (dataType_) { // ODBC conversion to ODBC2.0
+ case 9: // ODBC2 Date
+
+ // check the datetime code and set appropriately
+ switch (sqlDatetimeCode_) {
+ case SQLDTCODE_YEAR:
+ case SQLDTCODE_YEAR_TO_MONTH:
+ case SQLDTCODE_MONTH:
+ case SQLDTCODE_MONTH_TO_DAY:
+ case SQLDTCODE_DAY:
+ dataType_ = Types.OTHER;
+ precision_ = odbcPrecision;
+ displaySize_ = maxLen;
+ sqlOctetLength_ = maxLen;
+ break;
+ default:
+ dataType_ = Types.DATE;
+ break;
+ }
+ break;
+ case 10: // ODBC2 TIME
+ switch (sqlDatetimeCode_) {
+ case SQLDTCODE_HOUR:
+ case SQLDTCODE_HOUR_TO_MINUTE:
+ case SQLDTCODE_MINUTE:
+ case SQLDTCODE_MINUTE_TO_SECOND:
+ case SQLDTCODE_SECOND:
+ dataType_ = Types.OTHER;
+ precision_ = odbcPrecision;
+ displaySize_ = maxLen;
+ sqlOctetLength_ = maxLen;
+ break;
+ default:
+ dataType_ = Types.TIME;
+ break;
+ }
+ break;
+ case 11: // ODBC2 TIMESTAMP
+ switch (sqlDatetimeCode_) {
+ case SQLDTCODE_YEAR_TO_HOUR:
+ case SQLDTCODE_YEAR_TO_MINUTE:
+ case SQLDTCODE_MONTH_TO_HOUR:
+ case SQLDTCODE_MONTH_TO_MINUTE:
+ case SQLDTCODE_MONTH_TO_SECOND:
+ // case SQLDTCODE_MONTH_TO_FRACTION:
+ case SQLDTCODE_DAY_TO_HOUR:
+ case SQLDTCODE_DAY_TO_MINUTE:
+ case SQLDTCODE_DAY_TO_SECOND:
+ // case SQLDTCODE_DAY_TO_FRACTION:
+ case SQLDTCODE_HOUR_TO_FRACTION: // note: Database
+ // maps to TIME(6)
+ // NCS maps to TIMESTAMP
+ case SQLDTCODE_MINUTE_TO_FRACTION:
+ case SQLDTCODE_SECOND_TO_FRACTION:
+ dataType_ = Types.OTHER;
+ precision_ = odbcPrecision;
+ displaySize_ = maxLen;
+ sqlOctetLength_ = maxLen;
+ break;
+ default:
+ dataType_ = Types.TIMESTAMP;
+ break;
+ }
+ break;
+ default:
+ dataType_ = Types.TIMESTAMP;
+ break;
+ }
+ }
+
+ switch (dataType_) {
+ case Types.NUMERIC:
+ case Types.DECIMAL:
+ precision_ = odbcPrecision;
+ displaySize_ = precision_ + 2; // 1 for dot and 1 for sign
+ // if (scale != 0) // ODBC2.0
+ // isCurrency_ = true;
+ break;
+ case Types.SMALLINT:
+ precision_ = odbcPrecision;
+ if (isSigned_) {
+ displaySize_ = 6;
+ } else {
+ dataType_ = Types.INTEGER;
+ displaySize_ = 5;
+ }
+ break;
+ case Types.INTEGER:
+ precision_ = odbcPrecision;
+ if (isSigned_) {
+ displaySize_ = 11;
+ } else {
+ dataType_ = Types.BIGINT;
+ displaySize_ = 10;
+ }
+ break;
+ case Types.TINYINT:
+ precision_ = odbcPrecision;
+ if (isSigned_) {
+ displaySize_ = 4;
+ } else {
+ displaySize_ = 3;
+ }
+ break;
+ case Types.BIGINT:
+ precision_ = odbcPrecision;
+ if (isSigned_) {
+ displaySize_ = 20;
+ } else {
+ displaySize_ = 19;
+ }
+ break;
+ case Types.REAL:
+ precision_ = odbcPrecision;
+ displaySize_ = 15;
+ break;
+ case Types.DOUBLE:
+ case Types.FLOAT:
+ precision_ = odbcPrecision;
+ displaySize_ = 24;
+ break;
+ case Types.DATE:
+ sqlOctetLength_ = maxLen + 3;
+ displaySize_ = 10;
+ precision_ = 10; // ODBC2.0
+ break;
+ case Types.TIME:
+ sqlOctetLength_ = maxLen + 3;
+ displaySize_ = (precision == 0)?8: precision + 9;
+ precision_ = 8; // ODBC2.0
+ break;
+ case Types.TIMESTAMP:
+ sqlOctetLength_ = maxLen + 3;
+ precision_ = odbcPrecision;
+ displaySize_ = precision_;
+ if (sqlDatetimeCode_ > 3) // if it is more than 3, it is one of
+ // SQL/MP Datetime columns
+ {
+ // like YEAR, YEAR TO MONTH, YEAR TO DAY ...see dfs2rec.h
+ dataType_ = Types.OTHER;
+ }
+ break;
+ case Types.CHAR:
+
+ // sqlOctetLength_ = maxLen+1;
+ sqlOctetLength_ = maxLen;
+ displaySize_ = maxLen;
+ precision_ = maxLen; // ODBC2.0
+ break;
+ case Types.VARCHAR:
+ case Types.LONGVARCHAR:
+ case Types.BLOB:
+ case Types.CLOB:
+ boolean shortLength = maxLen < Math.pow(2, 15);
+ int dataOffset = ((shortLength) ? 2 : 4);
+ if (sqlDataType_ == SQLTYPECODE_VARCHAR) {
+ sqlOctetLength_ = maxLen + 1;
+ } else {
+ sqlOctetLength_ = maxLen + dataOffset + 1;
+ }
+ displaySize_ = maxLen;
+ precision_ = maxLen; // ODBC2.0
+ break;
+ default:
+ if (sqlDataType_ == SQLTYPECODE_INTERVAL) {
+ dataType_ = Types.OTHER;
+ precision_ = odbcPrecision;
+ displaySize_ = maxLen; // Make sure maxLen returns the right
+ // display size for interval
+ // sqlOctetLength_ = maxLen+3;
+ // Swastik - commented above line 02/10/2005 for Interval Data
+ // Type support
+ // 3 was added earlier because interval datatype was handled in
+ // the same
+ // way as varchar and varchar-long were handled. Since we are
+ // separating it
+ // we don't need to add the additional 3
+ sqlOctetLength_ = maxLen;
+ }
+ break;
+ }
+ if (sqlDataType_ == SQLTYPECODE_CHAR || sqlDataType_ == SQLTYPECODE_VARCHAR
+ || sqlDataType_ == SQLTYPECODE_BLOB || sqlDataType_ == SQLTYPECODE_CLOB
+ || sqlDataType_ == SQLTYPECODE_VARCHAR_LONG || sqlDataType_ == SQLTYPECODE_VARCHAR_WITH_LENGTH) {
+ isCaseSensitive_ = true;
+ }
+ isSearchable_ = true;
+ fsDataType_ = fsDataType;
+ intLeadPrec_ = intLeadPrec;
+ paramMode_ = paramMode;
+ } // end TrafT4Desc
+
+ // ---------------------------------------------------------------
+ // Constructors
+
+ TrafT4Desc(
+ int noNullValue // Descriptor2 only
+ ,
+ int nullValue // Descriptor2 only
+ ,
+ int version // Descriptor2 only
+ , int dataType, short datetimeCode, int maxLen, short precision, short scale, boolean nullInfo,
+ boolean signType // same as signe
+ , int odbcDataType, int odbcPrecision, int sqlCharset, int odbcCharset, String colName // same
+ // as
+ // colHeadingNm
+ , String tableName, String catalogName, String schemaName, String headingName // Descriptor2
+ // only
+ , int intLeadPrec, int paramMode, int fsDataType // fsDataType
+ // seems to be
+ // the same as
+ // dataType (see
+ // old
+ // descriptor)
+ , int rowLength) {
+
+ //
+ // Call the old constructor to set the items that are
+ // in both the old descriptor and the new descriptor.
+ //
+ this(dataType, datetimeCode, maxLen, precision, scale, nullInfo, colName, signType, odbcDataType,
+ (short) odbcPrecision, sqlCharset, odbcCharset, catalogName, schemaName, tableName, fsDataType,
+ intLeadPrec, paramMode);
+ //
+ // Set the items specific to the new descriptor.
+ //
+ noNullValue_ = noNullValue;
+ nullValue_ = nullValue;
+ version_ = version;
+ headingName_ = headingName;
+ rowLength_ = rowLength;
+
+ maxLen_ = maxLen;
+
+ } // end TrafT4Desc
+
+ // ---------------------------------------------------------------
+ /***************************************************************************
+ * Returns encoding type for character data types from Database
+ * COLS table.
+ */
+ String getCharacterSetName() throws SQLException {
+ switch (dataType_) {
+ case Types.CHAR:
+ case Types.VARCHAR:
+ case Types.LONGVARCHAR:
+ case Types.BLOB:
+ case Types.CLOB:
+ return (String) InterfaceUtilities.getCharsetName(sqlCharset_);
+ default:
+ return null;
+ }
+ }
+
+ // ---------------------------------------------------------------
+ // Constants
+ public static final int SQLTYPECODE_CHAR = 1;
+ public static final int SQLTYPECODE_VARCHAR = 12;
+ public static final int SQLTYPECODE_VARCHAR_LONG = -1;
+ public static final int SQLTYPECODE_INTERVAL = 10;
+ public static final int SQLTYPECODE_VARCHAR_WITH_LENGTH = -601;
+ public static final int SQLTYPECODE_BLOB = -602;
+ public static final int SQLTYPECODE_CLOB = -603;
+ public static final int SQLTYPECODE_SMALLINT = 5;
+ public static final int SQLTYPECODE_INTEGER = 4;
+
+ // datetime codes taken from NCS - File ....\....\...\Common\DrvrSrvr.h
+ public static final int SQLDTCODE_YEAR = 4;
+ public static final int SQLDTCODE_YEAR_TO_MONTH = 5;
+ // public static final int SQLDTCODE_YEAR_TO_DAY 1 //Database
+ // DATE
+ public static final int SQLDTCODE_YEAR_TO_HOUR = 7; // ODBC TIMESTAMP(0)
+ public static final int SQLDTCODE_YEAR_TO_MINUTE = 8;
+ // public static final int SQLDTCODE_YEAR_TO_SECOND 3 //
+ // DatabaseTIMESTAMP(0)
+ // public static final int SQLDTCODE_YEAR_TO_FRACTION 3 //
+ // Database TIMESTAMP(1 - 5)
+ public static final int SQLDTCODE_MONTH = 10;
+ public static final int SQLDTCODE_MONTH_TO_DAY = 11;
+ public static final int SQLDTCODE_MONTH_TO_HOUR = 12;
+ public static final int SQLDTCODE_MONTH_TO_MINUTE = 13;
+ public static final int SQLDTCODE_MONTH_TO_SECOND = 14;
+ public static final int SQLDTCODE_MONTH_TO_FRACTION = 14;
+ public static final int SQLDTCODE_DAY = 15;
+ public static final int SQLDTCODE_DAY_TO_HOUR = 16;
+ public static final int SQLDTCODE_DAY_TO_MINUTE = 17;
+ public static final int SQLDTCODE_DAY_TO_SECOND = 18;
+ public static final int SQLDTCODE_DAY_TO_FRACTION = 18;
+ public static final int SQLDTCODE_HOUR = 19;
+ public static final int SQLDTCODE_HOUR_TO_MINUTE = 20;
+ // define SQLDTCODE_HOUR_TO_SECOND 2 //Database TIME(0) --> NCS
+ // Maps this to TIME
+ public static final int SQLDTCODE_HOUR_TO_FRACTION = 2; // Database TIME(1 -
+ // 6) // MXCI Maps
+ // this to TIMESTAMP
+ public static final int SQLDTCODE_MINUTE = 22;
+ public static final int SQLDTCODE_MINUTE_TO_SECOND = 23;
+ public static final int SQLDTCODE_MINUTE_TO_FRACTION = 23;
+ public static final int SQLDTCODE_SECOND = 24;
+ public static final int SQLDTCODE_SECOND_TO_FRACTION = 24;
+ public static final int SQLDTCODE_FRACTION_TO_FRACTION = 29;
+
+ // fields
+ int sqlCharset_;
+ int odbcCharset_;
+ int sqlDataType_;
+ int dataType_;
+ short sqlPrecision_;
+ short sqlDatetimeCode_;
+ int sqlOctetLength_;
+ int isNullable_;
+ String name_;
+ short scale_;
+ int precision_;
+ boolean isSigned_;
+ boolean isCurrency_;
+ boolean isCaseSensitive_;
+ String catalogName_;
+ String schemaName_;
+ String tableName_;
+ int fsDataType_;
+ int intLeadPrec_;
+ int paramMode_;
+ int paramIndex_;
+ int paramPos_;
+
+ String columnClassName_;
+ int displaySize_;
+ // fields which are not pouplated now
+ String columnLabel_;
+ boolean isAutoIncrement_;
+ boolean isSearchable_;
+
+ boolean isValueSet_; // To denote if setXXX method is called for this
+ // parameter
+ // String paramValue_; // Contains the value of output parameter value
+ Object paramValue_; // Contains the value of output parameter value
+
+ int noNullValue_; // Descriptor2 only
+ int nullValue_; // Descriptor2 only
+ int version_; // Descriptor2 only
+
+ String headingName_; // Descriptor2 only
+
+ int rowLength_;
+ int maxLen_;
+
+} // end class TrafT4Desc
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Exception.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Exception.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Exception.java
new file mode 100644
index 0000000..0406195
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Exception.java
@@ -0,0 +1,38 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.SQLException;
+
+class TrafT4Exception extends SQLException {
+ protected String messageId;
+
+ public TrafT4Exception(String reason, String SQLState, int vendorCode, String msgId) {
+ super(reason, SQLState, vendorCode);
+ if (msgId == null) {
+ messageId = "";
+ } else {
+ messageId = msgId;
+ }
+ }
+
+} // end class TrafT4Exception
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Handle.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Handle.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Handle.java
new file mode 100644
index 0000000..9333081
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Handle.java
@@ -0,0 +1,84 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+
+public abstract class TrafT4Handle {
+ SQLWarning sqlWarning_;
+
+ public void clearWarnings() throws SQLException {
+ sqlWarning_ = null;
+ }
+
+ public SQLWarning getWarnings() throws SQLException {
+ return sqlWarning_;
+ }
+
+ void setSQLWarning(T4Properties t4props, String messageId, Object[] messageArguments) {
+ SQLWarning sqlWarningLeaf = TrafT4Messages.createSQLWarning(t4props, messageId, messageArguments);
+ if (sqlWarning_ == null) {
+ sqlWarning_ = sqlWarningLeaf;
+ } else {
+ sqlWarning_.setNextWarning(sqlWarningLeaf);
+ }
+ }
+
+ // Method used by JNI layer to set the warning
+ void setSqlWarning(SQLWarning sqlWarning) {
+ if (sqlWarning_ == null) {
+ sqlWarning_ = sqlWarning;
+ } else {
+ sqlWarning_.setNextWarning(sqlWarning);
+ }
+ }
+
+ // Method added to check if the connection had any errors
+ // This calls the abstract method closeErroredConnection()
+ //returns true if a connection error occured
+ boolean performConnectionErrorChecks(SQLException se) {
+ if (se instanceof TrafT4Exception) {
+ TrafT4Exception sqlmx_e = (TrafT4Exception) se;
+ if (sqlmx_e.messageId.equals(ERROR_SOCKET_WRITE_ERROR) || sqlmx_e.messageId.equals(ERROR_SOCKET_READ_ERROR)
+ || sqlmx_e.messageId.equals(ERROR_SOCKET_IS_CLOSED_ERROR)
+ || sqlmx_e.messageId.equals(ERROR_INVALID_CONNECTION) || sqlmx_e.messageId.equals(ERROR_IDS_08_S01)
+ || sqlmx_e.messageId.equals(IDS_S1_T00)
+ || sqlmx_e.messageId.equals(ERROR_SOCKET_OPEN)) {
+ closeErroredConnection(sqlmx_e);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ abstract void closeErroredConnection(TrafT4Exception se);
+
+ static final String ERROR_IDS_08_S01 = new String("ids_08_s01");
+ static final String ERROR_INVALID_CONNECTION = new String("invalid_connection");
+ static final String ERROR_SOCKET_WRITE_ERROR = new String("socket_write_error");
+ static final String ERROR_SOCKET_READ_ERROR = new String("socket_read_error");
+ static final String ERROR_SOCKET_IS_CLOSED_ERROR = new String("socket_is_closed_error");
+ static final String IDS_S1_T00 = new String("ids_s1_t00");
+ static final String ERROR_SOCKET_OPEN = new String("socket_open_error");
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Messages.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Messages.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Messages.java
new file mode 100644
index 0000000..312ce27
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Messages.java
@@ -0,0 +1,324 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.SQLWarning;
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+class TrafT4Messages {
+ static Logger getMessageLogger(T4Properties t4props) {
+ return (t4props != null) ? t4props.t4Logger_ : T4Properties.t4GlobalLogger;
+ }
+
+ static SQLWarning createSQLWarning(T4Properties t4props, String messageId, Object[] messageArguments) {
+ Logger log = getMessageLogger(t4props);
+
+ if (log != null && log.isLoggable(Level.WARNING)) {
+ Object p[] = T4LoggingUtilities.makeParams(t4props, messageId, messageArguments);
+ log.logp(Level.WARNING, "TrafT4Messages", "createSQLWarning", "", p);
+ }
+
+ Locale currentLocale = t4props == null ? null : t4props.getLocale();
+ currentLocale = currentLocale == null ? Locale.getDefault() : currentLocale;
+
+ int sqlcode = 1;
+ SQLWarning ret = null;
+
+ try {
+ PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("T4Messages",
+ currentLocale);
+
+ MessageFormat formatter = new MessageFormat("");
+ formatter.setLocale(currentLocale);
+ formatter.applyPattern(messageBundle.getString(messageId + "_msg"));
+
+ String message = formatter.format(messageArguments);
+ String sqlState = messageBundle.getString(messageId + "_sqlstate");
+ String sqlcodeStr = messageBundle.getString(messageId + "_sqlcode");
+
+ if (sqlcodeStr != null) {
+ try {
+ sqlcode = Integer.parseInt(sqlcodeStr);
+ } catch (NumberFormatException e1) {
+ // use 1 as default
+ }
+ }
+
+ ret = new SQLWarning(message, sqlState, sqlcode);
+ } catch (MissingResourceException e) {
+ // If the resource bundle is not found, concatenate the messageId
+ // and the parameters
+ String message;
+ int i = 0;
+
+ message = "The message id: " + messageId;
+ if (messageArguments != null) {
+ message = message.concat(" With parameters: ");
+ while (true) {
+ message = message.concat(messageArguments[i++].toString());
+ if (i >= messageArguments.length) {
+ break;
+ } else {
+ message = message.concat(",");
+ }
+ }
+ } // end if
+
+ ret = new SQLWarning(message, "01000", 1);
+ }
+
+ return ret;
+ }
+
+ static void setSQLWarning(T4Properties t4props, TrafT4Handle handle, SQLWarningOrError[] we1) {
+ Logger log = getMessageLogger(t4props);
+
+ int curErrorNo;
+ SQLWarning sqlWarningLeaf;
+
+ if (we1.length == 0) {
+ handle.setSqlWarning(null);
+ return;
+ }
+
+ for (curErrorNo = 0; curErrorNo < we1.length; curErrorNo++) {
+ if (log != null && log.isLoggable(Level.WARNING)) {
+ Object p[] = new Object[] { t4props, "Text: " + we1[curErrorNo].text,
+ "SQLState: " + we1[curErrorNo].sqlState, "SQLCode: " + we1[curErrorNo].sqlCode };
+ log.logp(Level.WARNING, "TrafT4Messages", "setSQLWarning", "", p);
+ }
+
+ sqlWarningLeaf = new SQLWarning(we1[curErrorNo].text, we1[curErrorNo].sqlState, we1[curErrorNo].sqlCode);
+ handle.setSqlWarning(sqlWarningLeaf);
+ } // end for
+ return;
+ }
+
+ static void setSQLWarning(T4Properties t4props, TrafT4Handle handle, ERROR_DESC_LIST_def sqlWarning) {
+ Logger log = getMessageLogger(t4props);
+
+ int curErrorNo;
+ ERROR_DESC_def error_desc_def[];
+ SQLWarning sqlWarningLeaf;
+
+ if (sqlWarning.length == 0) {
+ handle.setSqlWarning(null);
+ return;
+ }
+
+ error_desc_def = sqlWarning.buffer;
+ for (curErrorNo = 0; curErrorNo < sqlWarning.length; curErrorNo++) {
+ if (log != null && log.isLoggable(Level.WARNING)) {
+ Object p[] = new Object[] { t4props, "Text: " + error_desc_def[curErrorNo].errorText,
+ "SQLState: " + error_desc_def[curErrorNo].sqlstate,
+ "SQLCode: " + error_desc_def[curErrorNo].sqlcode };
+ log.logp(Level.WARNING, "TrafT4Messages", "setSQLWarning", "", p);
+ }
+
+ sqlWarningLeaf = new SQLWarning(error_desc_def[curErrorNo].errorText, error_desc_def[curErrorNo].sqlstate,
+ error_desc_def[curErrorNo].sqlcode);
+ handle.setSqlWarning(sqlWarningLeaf);
+ }
+ return;
+ } // end setSQLWarning
+
+ // ------------------------------------------------------------------------------------------------
+ static void throwSQLException(T4Properties t4props, ERROR_DESC_LIST_def SQLError) throws TrafT4Exception {
+ Logger log = getMessageLogger(t4props);
+ Locale locale = (t4props != null) ? t4props.getLocale() : Locale.getDefault();
+
+ TrafT4Exception sqlException = null;
+ TrafT4Exception sqlExceptionHead = null;
+ int curErrorNo;
+
+ if (SQLError.length == 0) {
+ throw createSQLException(t4props, locale, "No messages in the Error description", null);
+ }
+
+ for (curErrorNo = 0; curErrorNo < SQLError.length; curErrorNo++) {
+ if (log != null && log.isLoggable(Level.SEVERE)) {
+ Object p[] = new Object[] { t4props, "Text: " + SQLError.buffer[curErrorNo].errorText,
+ "SQLState: " + SQLError.buffer[curErrorNo].sqlstate,
+ "SQLCode: " + SQLError.buffer[curErrorNo].sqlcode };
+ log.logp(Level.SEVERE, "TrafT4Messages", "throwSQLException", "", p);
+ }
+
+ if (SQLError.buffer[curErrorNo].errorCodeType == TRANSPORT.ESTIMATEDCOSTRGERRWARN) {
+ //
+ // NCS said it was an SQL error, but it really wasn't it was a
+ // NCS resource governing error
+ //
+ sqlException = TrafT4Messages.createSQLException(t4props, locale, "resource_governing", null);
+ } else {
+ sqlException = new TrafT4Exception(SQLError.buffer[curErrorNo].errorText,
+ SQLError.buffer[curErrorNo].sqlstate, SQLError.buffer[curErrorNo].sqlcode, null);
+ }
+ if (curErrorNo == 0) {
+ sqlExceptionHead = sqlException;
+ } else {
+ sqlExceptionHead.setNextException(sqlException);
+ }
+ }
+
+ throw sqlExceptionHead;
+ }
+
+ // ------------------------------------------------------------------------------------------------
+ static void throwSQLException(T4Properties t4props, SQLWarningOrError[] we1) throws TrafT4Exception {
+ Logger log = getMessageLogger(t4props);
+ Locale locale = (t4props != null) ? t4props.getLocale() : Locale.getDefault();
+
+ TrafT4Exception sqlException = null;
+ TrafT4Exception sqlExceptionHead = null;
+ int curErrorNo;
+
+ if (we1.length == 0) {
+ throw createSQLException(t4props, locale, "No messages in the Error description", null);
+ }
+
+ for (curErrorNo = 0; curErrorNo < we1.length; curErrorNo++) {
+ if (log != null && log.isLoggable(Level.SEVERE)) {
+ Object p[] = new Object[] { t4props, "Text: " + we1[curErrorNo].text,
+ "SQLState: " + we1[curErrorNo].sqlState, "SQLCode: " + we1[curErrorNo].sqlCode };
+ log.logp(Level.SEVERE, "TrafT4Messages", "throwSQLException", "", p);
+ }
+
+ sqlException = new TrafT4Exception(we1[curErrorNo].text, we1[curErrorNo].sqlState, we1[curErrorNo].sqlCode,
+ null);
+ if (curErrorNo == 0) {
+ sqlExceptionHead = sqlException;
+ } else {
+ sqlExceptionHead.setNextException(sqlException);
+ }
+ } // end for
+
+ throw sqlExceptionHead;
+ } // end throwSQLException
+
+ // ------------------------------------------------------------------------------------------------
+ static TrafT4Exception createSQLException(T4Properties t4props, Locale msgLocale, String messageId, Object mA1,
+ Object mA2) {
+
+ Object[] mAs = new Object[2];
+
+ mAs[0] = mA1;
+ mAs[1] = mA2;
+
+ return createSQLException(t4props, msgLocale, messageId, mAs);
+
+ } // end createSQLException
+
+ // ------------------------------------------------------------------------------------------------
+ static TrafT4Exception createSQLException(T4Properties t4props, Locale msgLocale, String messageId,
+ Object messageArgument) {
+ Object[] mAs = new Object[1];
+
+ mAs[0] = messageArgument;
+
+ return createSQLException(t4props, msgLocale, messageId, mAs);
+
+ } // end createSQLException
+
+ // ------------------------------------------------------------------------------------------------
+ static TrafT4Exception createSQLException(T4Properties t4props, Locale msgLocale, String messageId,
+ Object[] messageArguments) {
+ Logger log = getMessageLogger(t4props);
+
+ if (log != null && log.isLoggable(Level.SEVERE)) {
+ Object p[] = T4LoggingUtilities.makeParams(t4props, messageId, messageArguments);
+ log.logp(Level.SEVERE, "TrafT4Messages", "createSQLException", "", p);
+ }
+
+ Locale currentLocale = t4props == null ? null : t4props.getLocale();
+ currentLocale = currentLocale == null ? Locale.getDefault(): currentLocale;
+
+ int sqlcode;
+ try {
+ PropertyResourceBundle messageBundle = (PropertyResourceBundle) ResourceBundle.getBundle("T4Messages",
+ currentLocale);
+
+ MessageFormat formatter = new MessageFormat("");
+ formatter.setLocale(currentLocale);
+ formatter.applyPattern(messageBundle.getString(messageId + "_msg"));
+
+ String message = formatter.format(messageArguments);
+ String sqlState = messageBundle.getString(messageId + "_sqlstate");
+ String sqlcodeStr = messageBundle.getString(messageId + "_sqlcode");
+
+ if (sqlcodeStr != null) {
+ try {
+ sqlcode = Integer.parseInt(sqlcodeStr);
+ sqlcode = -sqlcode;
+ } catch (NumberFormatException e1) {
+ sqlcode = -1;
+ }
+ } else {
+ sqlcode = -1;
+
+ }
+ return new TrafT4Exception(message, sqlState, sqlcode, messageId);
+ } catch (MissingResourceException e) {
+ // If the resource bundle is not found, concatenate the messageId
+ // and the parameters
+ String message;
+ int i = 0;
+
+ message = "The message id: " + messageId;
+ if (messageArguments != null) {
+ message = message.concat(" With parameters: ");
+ while (true) {
+ message = message.concat(messageArguments[i++] + "");
+ if (i >= messageArguments.length) {
+ break;
+ } else {
+ message = message.concat(",");
+ }
+ }
+ } // end if
+
+ return new TrafT4Exception(message, "HY000", -1, messageId);
+ } // end catch
+ } // end createSQLException
+
+ // ------------------------------------------------------------------------------------------------
+ static void throwUnsupportedFeatureException(T4Properties t4props, Locale locale, String s) throws TrafT4Exception {
+ Object[] messageArguments = new Object[1];
+
+ messageArguments[0] = s;
+ throw TrafT4Messages.createSQLException(t4props, locale, "unsupported_feature", messageArguments);
+ } // end throwUnsupportedFeatureException
+
+ // ------------------------------------------------------------------------------------------------
+ static void throwDeprecatedMethodException(T4Properties t4props, Locale locale, String s) throws TrafT4Exception {
+ Object[] messageArguments = new Object[1];
+
+ messageArguments[0] = s;
+ throw TrafT4Messages.createSQLException(t4props, locale, "deprecated_method", messageArguments);
+ } // end throwDeprecatedMethodException
+
+} // end class TrafT4Messages
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ParameterMetaData.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ParameterMetaData.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ParameterMetaData.java
new file mode 100644
index 0000000..461d144
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ParameterMetaData.java
@@ -0,0 +1,243 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.SQLException;
+import java.util.logging.Level;
+
+public class TrafT4ParameterMetaData implements java.sql.ParameterMetaData {
+
+ public String getParameterClassName(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+ return inputDesc[param - 1].getColumnClassName();
+ }
+
+ public int getParameterCount() throws SQLException {
+ return inputDesc.length;
+ }
+
+ public int getParameterMode(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+ return inputDesc[param - 1].paramMode_;
+ }
+
+ public int getParameterType(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+ return inputDesc[param - 1].dataType_;
+ }
+
+ public String getParameterTypeName(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].getColumnTypeName(props.getLocale());
+ }
+
+ public int getPrecision(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].precision_;
+ }
+
+ public int getScale(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].scale_;
+ }
+
+ public int isNullable(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].isNullable_;
+ }
+
+ public boolean isSigned(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+ return inputDesc[param - 1].isSigned_;
+ }
+
+ // ////////////////////////
+ // begin custom accessors//
+ // ////////////////////////
+ public int getRowLength() throws SQLException {
+ // this is the same for all params
+ // only if we have no input params will we throw an error
+ if (inputDesc.length == 0) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[0].rowLength_;
+ }
+
+ public int getDisplaySize(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].displaySize_;
+ }
+
+ public int getFSDataType(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].fsDataType_;
+ }
+
+ public int getMaxLength(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].maxLen_;
+ }
+
+ public int getNoNullOffset(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].noNullValue_;
+ }
+
+ public int getNullOffset(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].nullValue_;
+ }
+
+ public int getOdbcCharset(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].odbcCharset_;
+ }
+
+ public int getSqlCharset(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].sqlCharset_;
+ }
+
+ public int getSqlDataType(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].sqlDataType_;
+ }
+
+ public int getSqlDatetimeCode(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].sqlDatetimeCode_;
+ }
+
+ public int getSqlOctetLength(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].sqlOctetLength_;
+ }
+
+ public int getSqlPrecision(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].sqlPrecision_;
+ }
+
+ // /////////////////////////////////
+ // these are legacy names...do not remove these yet even though they are
+ // duplicate
+ // i will depricate these before 2.3 release
+ // ///////////////////////////////
+
+ /**
+ * @deprecated
+ */
+ public int getSqlTypeCode(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].dataType_;
+ }
+
+ /**
+ * @deprecated
+ */
+ public int getSqlLength(int param) throws SQLException {
+ if (param > inputDesc.length) {
+ throw TrafT4Messages.createSQLException(props, props.getLocale(), "invalid_desc_index", null);
+ }
+
+ return inputDesc[param - 1].maxLen_;
+ }
+
+ TrafT4ParameterMetaData(TrafT4PreparedStatement stmt, TrafT4Desc[] inputDesc) {
+ this.props = stmt.connection_.props_;
+ this.inputDesc = inputDesc;
+
+ if (props.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(stmt.connection_.props_, stmt, inputDesc);
+ stmt.connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4ParameterMetaData", "", "", p);
+ }
+ }
+
+ T4Properties props;
+ TrafT4Desc[] inputDesc;
+ public Object unwrap(Class iface) throws SQLException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isWrapperFor(Class iface) throws SQLException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnection.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnection.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnection.java
new file mode 100644
index 0000000..edacd1e
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnection.java
@@ -0,0 +1,238 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.LinkedList;
+import java.util.Locale;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+
+import javax.sql.ConnectionEvent;
+import javax.sql.ConnectionEventListener;
+import javax.sql.StatementEventListener;
+
+public class TrafT4PooledConnection implements javax.sql.PooledConnection {
+
+ public void addConnectionEventListener(ConnectionEventListener listener) {
+ try {
+ if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
+ connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4PooledConnecton", "addConnectionEventListener", "",
+ p);
+ }
+ if (connection_ != null && connection_.props_.getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4PooledConnection");
+ lr.setSourceMethodName("addConnectionEventListener");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ connection_.props_.getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ if (isClosed_ || connection_ == null) {
+ return;
+ }
+ listenerList_.add(listener);
+ }
+
+ public void close() throws SQLException {
+ if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
+ connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4PooledConnecton", "close", "", p);
+ }
+ if (connection_ != null && connection_.props_.getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4PooledConnection");
+ lr.setSourceMethodName("close");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ connection_.props_.getLogWriter().println(temp);
+ }
+
+ //3196 - NDCS transaction for SPJ
+ if (connection_.ic_.suspendRequest_) {
+ connection_.suspendUDRTransaction();
+ }
+
+ if (isClosed_) {
+ return;
+ }
+ connection_.close(true, true);
+ }
+
+ public Connection getConnection() throws SQLException {
+ if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
+ connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4PooledConnecton", "getConnection", "", p);
+ }
+ if (connection_ != null && connection_.props_.getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4PooledConnection");
+ lr.setSourceMethodName("getConnection");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ connection_.props_.getLogWriter().println(temp);
+ }
+ if (isClosed_ || connection_ == null) {
+ throw TrafT4Messages.createSQLException(connection_.props_, locale_, "invalid_connection", null);
+ }
+ if (LogicalConnectionInUse_) {
+ connection_.close(false, false);
+ }
+ LogicalConnectionInUse_ = true;
+ connection_.reuse();
+ return connection_;
+ }
+
+ public void removeConnectionEventListener(ConnectionEventListener listener) {
+ try {
+ if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
+ connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4PooledConnecton", "removeConnectionEventListener",
+ "", p);
+ }
+ if (connection_ != null && connection_.props_.getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_, listener);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4PooledConnection");
+ lr.setSourceMethodName("removeConnectionEventListener");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ connection_.props_.getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ if (isClosed_ || connection_ == null) {
+ return;
+ }
+ listenerList_.remove(listener);
+ }
+
+ // Called by TrafT4Connection when the connection is closed by the application
+ void logicalClose(boolean sendEvents) {
+ int i;
+ int totalListener;
+ ConnectionEventListener listener;
+
+ LogicalConnectionInUse_ = false;
+
+ try {
+ //3196 - NDCS transaction for SPJ
+ if (connection_.ic_.suspendRequest_) {
+ connection_.suspendUDRTransaction();
+ }
+ }
+ catch (SQLException ex) {}
+
+ if (sendEvents) {
+ totalListener = listenerList_.size();
+ ConnectionEvent event = new ConnectionEvent(this);
+ for (i = 0; i < totalListener; i++) {
+ listener = (ConnectionEventListener) listenerList_.get(i);
+ listener.connectionClosed(event);
+ }
+ }
+ }
+
+ void sendConnectionErrorEvent(SQLException ex) throws SQLException {
+ int i;
+ int totalListener;
+ ConnectionEventListener listener;
+
+ LogicalConnectionInUse_ = false;
+ totalListener = listenerList_.size();
+ ConnectionEvent event = new ConnectionEvent(this, ex);
+ for (i = 0; i < totalListener; i++) {
+ listener = (ConnectionEventListener) listenerList_.get(i);
+ listener.connectionErrorOccurred(event);
+ }
+ close();
+ }
+
+ // Constructor
+ TrafT4PooledConnection(TrafT4ConnectionPoolDataSource pds, T4Properties t4props) throws SQLException {
+ super();
+
+ T4Properties t4LocalProps;
+
+ pds_ = pds;
+ if (t4props != null) {
+ t4LocalProps = t4props;
+ locale_ = t4props.getLocale();
+ } else {
+ t4LocalProps = new T4Properties();
+ locale_ = Locale.getDefault();
+ }
+ listenerList_ = new LinkedList();
+ connection_ = new TrafT4Connection(this, t4LocalProps);
+ try {
+ if (connection_ != null && connection_.props_.t4Logger_.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_, pds, t4props);
+ connection_.props_.t4Logger_.logp(Level.FINE, "TrafT4PooledConnecton", "", "", p);
+ }
+ if (connection_ != null && connection_.props_.getLogWriter() != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(connection_.props_, pds, t4props);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4PooledConnection");
+ lr.setSourceMethodName("");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ connection_.props_.getLogWriter().println(temp);
+ }
+ } catch (SQLException se) {
+ // ignore
+ }
+ }
+
+ TrafT4Connection getTrafT4ConnectionReference() {
+ return connection_;
+ }
+
+ private LinkedList listenerList_;
+ private boolean isClosed_ = false;
+ private TrafT4ConnectionPoolDataSource pds_;
+ private TrafT4Connection connection_;
+ private Locale locale_;
+ private boolean LogicalConnectionInUse_ = false;
+ public void addStatementEventListener(StatementEventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void removeStatementEventListener(StatementEventListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/38e49cf7/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnectionManager.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnectionManager.java b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnectionManager.java
new file mode 100644
index 0000000..e31cd9d
--- /dev/null
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4PooledConnectionManager.java
@@ -0,0 +1,385 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+
+package org.trafodion.jdbc.t4;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Collections;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+
+import javax.sql.ConnectionEvent;
+import javax.sql.ConnectionPoolDataSource;
+import javax.sql.PooledConnection;
+
+public class TrafT4PooledConnectionManager implements javax.sql.ConnectionEventListener {
+
+ public void connectionClosed(ConnectionEvent event) {
+ if (T4Properties.t4GlobalLogger.isLoggable(Level.FINE) == true) {
+ Object p[] = T4LoggingUtilities.makeParams(null, event);
+ T4Properties.t4GlobalLogger.logp(Level.FINE, "TrafT4PooledConnectionManager", "connectionClosed", "", p);
+ }
+ if (out_ != null) {
+ LogRecord lr = new LogRecord(Level.FINE, "");
+ Object p[] = T4LoggingUtilities.makeParams(null, event);
+ lr.setParameters(p);
+ lr.setSourceClassName("TrafT4PooledConnectionManager");
+ lr.setSourceMethodName("connectionClosed");
+ T4LogFormatter lf = new T4LogFormatter();
+ String temp = lf.format(lr);
+ out_.println(temp);
+ }
+ if (out_ != null) {
+ if (traceLevel_ != Level.OFF) {
+ out_.println(traceId_ + "connectionClosed(" + event + ")");
+ }
+ }
+ PooledConnection pc;
+
+ pc = (PooledConnection) event.getSource();
+
+ boolean addToFreePool = true;
+ if (minPoolSize_ > 0 && free_.size() >= minPoolSize_) {
+ addToFreePool = false;
+ }
+ // If an initial pool is being created, then ensure that the connection
+ // is
+ // added to the free pool irrespective of minPoolSize being reached
+ if (initialPoolCreationFlag_) {
+ addToFreePool = true;
+ }
+ boolean wasPresent = removeInUseConnection(pc, addToFreePool);
+
+ if (wasPresent && (!addToFreePool)) {
+ try {
+ pc.close();
+ } catch (SQLException e) {
+ // ignore any close error
+ }
+ }
+ }
+
+ public void connectionErrorOccurred(ConnectionEvent event) {
+ if (out_ != null) {
+ if (traceLevel_ != Level.OFF) {
+ out_.println(traceId_ + "connectionErrorOccurred(" + event + ")");
+ }
+ }
+
+ PooledConnection pc;
+
+ pc = (PooledConnection) event.getSource();
+ try {
+ pc.close();
+ } catch (SQLException e) {
+ // ignore any close error
+ }
+ removeInUseConnection(pc, false);
+ }
+
+ public Connection getConnection() throws SQLException {
+ if (out_ != null) {
+ if (traceLevel_ != Level.OFF) {
+ out_.println(traceId_ + "getConnection()");
+ }
+ }
+
+ PooledConnection pc;
+ boolean validConnection = false;
+
+ do {
+ if (free_.size() == 0) {
+ if (maxPoolSize_ == 0 || count_ < maxPoolSize_) {
+ pc = pds_.getPooledConnection();
+ count_++;
+ pc.addConnectionEventListener(this);
+ inUse_.add(pc);
+
+ TrafT4Connection c = (TrafT4Connection) pc.getConnection();
+ try {
+ c.ic_.enforceT4ConnectionTimeout(c);
+ validConnection = true;
+ } catch (SQLException sqlEx) {
+ try {
+ pc.close();
+ } catch (Exception e) {
+ } // cleanup, ignore any errors
+ }
+ } else {
+ throw TrafT4Messages.createSQLException(null, null, "max_pool_size_reached", null);
+ }
+ } else {
+ pc = (PooledConnection) free_.get(0);
+ if (removeFreeConnection(pc, true)) {
+ TrafT4Connection c = (TrafT4Connection) pc.getConnection();
+ try {
+ c.ic_.enforceT4ConnectionTimeout(c);
+ validConnection = true;
+ } catch (SQLException sqlEx) {
+ try {
+ pc.close();
+ } catch (Exception e) {
+ } // cleanup, ignore any errors
+ }
+ }
+ }
+ } while (!validConnection);
+
+ return pc.getConnection();
+ }
+
+ private synchronized boolean removeFreeConnection(PooledConnection pc, boolean addToUsePool) {
+ boolean wasPresent = free_.remove(pc);
+ hashTab_.remove(pc);
+ if (wasPresent) {
+ if (addToUsePool) {
+ inUse_.add(pc);
+ } else {
+ count_--;
+ }
+ }
+ return wasPresent;
+ }
+
+ private synchronized boolean removeInUseConnection(PooledConnection pc, boolean addToFreePool) {
+ boolean wasPresent = inUse_.remove(pc);
+ hashTab_.remove(pc);
+ if (wasPresent) {
+ if (addToFreePool) {
+ hashTab_.put(pc, new Long(System.currentTimeMillis() + (1000 * maxIdleTime_)));
+ free_.add(pc);
+ } else {
+ count_--;
+ }
+ }
+ return wasPresent;
+ }
+
+ private void createInitialPool(int initialPoolSize) throws SQLException {
+ if (initialPoolSize <= 0) {
+ return;
+ }
+
+ int limit = initialPoolSize > maxPoolSize_ ? maxPoolSize_ : initialPoolSize;
+ Connection initPool_[] = new Connection[limit];
+ int created = 0;
+ try {
+ // Set initialPoolInCreation to indicate that an initial pool is in
+ // the
+ // process of being created.
+ initialPoolCreationFlag_ = true;
+
+ for (int i = 0; i < limit; i++) {
+ initPool_[i] = getConnection();
+ created++;
+ }
+ } catch (SQLException se) {
+ SQLException head = TrafT4Messages.createSQLException(null, null, "initial_pool_creation_error", "" + limit);
+ head.setNextException(se);
+ throw head;
+ } finally {
+ for (int i = 0; i < created; i++) {
+ try {
+ if (initPool_[i] != null)
+ initPool_[i].close();
+ } catch (SQLException se) {
+ // ignore
+ }
+ }
+ // Ensuring that the initialPoolInCreation has been set to false to
+ // indicate
+ // that the initial pool creation process has occured.
+ initialPoolCreationFlag_ = false;
+ }
+ }
+
+ void setLogWriter(PrintWriter out) {
+ out_ = out;
+ }
+
+ TrafT4PooledConnectionManager(TrafT4ConnectionPoolDataSource pds, Level traceLevel) throws SQLException {
+ String className = getClass().getName();
+ pds_ = pds;
+ inUse_ = Collections.synchronizedList(new LinkedList());
+ free_ = Collections.synchronizedList(new LinkedList());
+ maxPoolSize_ = pds.getMaxPoolSize();
+ minPoolSize_ = pds.getMinPoolSize();
+ maxIdleTime_ = pds.getMaxIdleTime();
+ connectionTimeout_ = pds.getConnectionTimeout();
+ traceLevel_ = traceLevel;
+ timer_ = null;
+ if (maxIdleTime_ > 0 && maxPoolSize_ > 0) {
+ IdleConnectionCleanupTask timerTask_ = new IdleConnectionCleanupTask();
+ timer_ = new Timer(true);
+ timer_.schedule(timerTask_, (maxIdleTime_ * 1000), (maxIdleTime_ * 500));
+ }
+ if (connectionTimeout_ > 0 && maxPoolSize_ > 0) {
+ ConnectionTimeoutCleanupTask timerTask_ = new ConnectionTimeoutCleanupTask();
+ if (timer_ == null) {
+ timer_ = new Timer(true);
+ }
+ timer_.schedule(timerTask_, (connectionTimeout_ * 1000), (connectionTimeout_ * 500));
+ }
+ createInitialPool(pds.getInitialPoolSize());
+ traceId_ = "jdbcTrace:[" + Thread.currentThread() + "]:[" + hashCode() + "]:" + className + ".";
+ }
+
+ ConnectionPoolDataSource pds_;
+ // LinkedList inUse_;
+ // LinkedList free_;
+ List inUse_;
+ List free_;
+ int count_;
+
+ int maxPoolSize_;
+ int minPoolSize_;
+ long maxIdleTime_;
+ int connectionTimeout_;
+ Level traceLevel_;
+ PrintWriter out_;
+ String traceId_;
+ Timer timer_;
+ Hashtable hashTab_ = new java.util.Hashtable(); // synchronized
+ // We keep a flag to indicate to this class that an initial pool is in the
+ // process
+ // of being created
+ boolean initialPoolCreationFlag_ = false;
+
+ /*
+ * Private class used to clean up the connections that have surpassed
+ * maxIdleTime
+ */
+ /* Start TimerTask definition */
+ private class IdleConnectionCleanupTask extends TimerTask {
+ Vector toRemove = null;
+
+ IdleConnectionCleanupTask() {
+ toRemove = new Vector();
+ }
+
+ public void run() {
+ cleanUp();
+ }
+
+ private void cleanUp() {
+ toRemove.clear();
+ synchronized (free_) {
+ try {
+ Iterator it_ = free_.iterator();
+ while (it_.hasNext()) {
+ PooledConnection tempPC = (PooledConnection) it_.next();
+ Long timeOutVal = (Long) hashTab_.get(tempPC);
+ if (System.currentTimeMillis() > timeOutVal.longValue()) {
+ toRemove.add(tempPC);
+ }
+ }
+ } catch (Throwable t) {
+ if (T4Properties.t4GlobalLogger.isLoggable(Level.WARNING) == true) {
+ T4Properties.t4GlobalLogger.logp(Level.WARNING, "IdleConnectionCleanupTask", "cleanUp", t
+ .getMessage());
+ }
+ }
+ } // synchronized block
+ for (int i = 0; i < toRemove.size(); i++) {
+ PooledConnection pc = (PooledConnection) toRemove.get(i);
+ boolean wasPresent = removeFreeConnection(pc, false);
+ if (wasPresent) {
+ // close it to cleanup
+ try {
+ /*
+ * System.out.println("Closing connection : " + (
+ * (TrafT4Connection) ( (TrafT4PooledConnection)
+ * pc).getConnection()).getDialogueId());
+ */
+ pc.close();
+ } catch (SQLException se) {
+ // Ignore
+ }
+ }
+ }
+ }
+ }
+
+ /* End TimerTask definition */
+ /*
+ * Private class used to clean up the connections that have surpassed
+ * connectionTimeout
+ */
+ /* Start TimerTask definition */
+ private class ConnectionTimeoutCleanupTask extends TimerTask {
+ Vector toRemove = null;
+
+ ConnectionTimeoutCleanupTask() {
+ toRemove = new Vector();
+ }
+
+ public void run() {
+ cleanUp();
+ }
+
+ private void cleanUp() {
+ toRemove.clear();
+ synchronized (inUse_) {
+ Iterator it_ = inUse_.iterator();
+ while (it_.hasNext()) {
+ try {
+ PooledConnection tempPC = (PooledConnection) it_.next();
+ InterfaceConnection ic = ((TrafT4PooledConnection) tempPC).getTrafT4ConnectionReference().ic_;
+ if (ic != null) {
+ T4Connection tconn = ic.getT4Connection();
+ if (tconn != null) {
+ if (tconn.connectionIdleTimeoutOccured()) {
+ // System.out.println("********* Found a
+ // timed out connection **********");
+ toRemove.add(tempPC);
+ }
+ }
+ }
+ } catch (Throwable t) {
+ if (T4Properties.t4GlobalLogger.isLoggable(Level.WARNING) == true) {
+ T4Properties.t4GlobalLogger.logp(Level.WARNING, "ConnectionTimeoutCleanupTask", "cleanUp",
+ t.getMessage());
+ }
+ }
+ }
+ } // synchronized block
+ for (int i = 0; i < toRemove.size(); i++) {
+ PooledConnection pc = (PooledConnection) toRemove.get(i);
+ removeInUseConnection(pc, false);
+ // do not close the connections because:
+ // 1.> Corresponding NCS server is already gone
+ // 2.> We need to give a timeout error when user uses this
+ // connection
+ }
+ }
+ }
+ /* End TimerTask definition */
+
+}