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; + } + } +}
