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 2017/04/18 23:52:40 UTC
[20/44] incubator-trafodion git commit: Refact package name
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51a83dc2/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebug.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebug.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebug.java
deleted file mode 100644
index 8bb3f30..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebug.java
+++ /dev/null
@@ -1,209 +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 @@@
-/*
- * Filename : JdbcDebug.java
- */
-
-package org.trafodion.jdbc.t2;
-
-class JdbcDebug
-{
- static final int debugFlagThreads = 0x80000000;
- static final int debugFlagDirtyMem = 0x40000000;
- static final int debugFlagTimer = 0x20000000;
- static final int debugFlagNoTime = 0x10000000;
- static final int debugFlagTestware = 0x08000000;
- static final int debugLevelEntry = 0x00000001;
- static final int debugLevelJava = 0x00000002;
- static final int debugLevelMem = 0x00000004;
- static final int debugLevelMemLeak = 0x00000008;
- static final int debugLevelCLI = 0x00000010;
- static final int debugLevelData = 0x00000020;
- static final int debugLevelTxn = 0x00000040;
- static final int debugLevelRowset = 0x00000080;
- static final int debugLevelError = 0x00000100;
- static final int debugLevelMetadata = 0x00000200;
- static final int debugLevelUnicode = 0x00000400;
- static final int debugLevelPooling = 0x00000800;
- static final int debugLevelStmt = 0x00001000;
- static final int debugLevelAll = 0x0000ffff;
-
- //Venu changed debugHandle and methodNameHandle from int to long for 64 bit
- long debugHandle;
- long methodNameHandle;
-
- JdbcDebug(String class_name, String method_name)
- {
- methodNameHandle = getMethodNameHandle("JAVA_COM_HP_SQLMX_" + class_name + "_" + method_name);
- debugHandle = getDebugHandle(methodNameHandle);
- }
-
-
- void traceOut(int debug_level, String message)
- {
- if (!JdbcDebugCfg.traceActive)
- {
- System.out.println("traceOut() called during non-tracing processing");
- System.exit(1);
- }
- traceOut(debugHandle,debug_level,message);
- }
-
- void methodEntry()
- {
- if (!JdbcDebugCfg.entryActive)
- {
- System.out.println("methodEntry() called during non-entry processing");
- System.exit(1);
- }
- methodEntry(debugHandle,debugLevelJava,methodNameHandle);
- }
-
- void methodEntry(int debug_level)
- {
- if (!JdbcDebugCfg.entryActive)
- {
- System.out.println("methodEntry(I) called during non-entry processing");
- System.exit(1);
- }
- methodEntry(debugHandle,debug_level|debugLevelJava,methodNameHandle);
- }
-
- void methodParameters(String parameters)
- {
- if (!JdbcDebugCfg.traceActive)
- {
- System.out.println("methodParameters() called during non-traceing processing");
- System.exit(1);
- }
- traceOut(debugHandle,debugLevelEntry|debugLevelJava," (" + parameters + ")");
- }
-
- void methodExit()
- {
- if (!JdbcDebugCfg.entryActive)
- {
- System.out.println("methodExit() called during non-entry processing");
- System.exit(1);
- }
- methodExit(debugHandle);
- }
-
- void methodReturn(String message)
- {
- if (!JdbcDebugCfg.traceActive)
- {
- System.out.println("methodReturn() called during non-traceing processing");
- System.exit(1);
- }
- methodReturn(debugHandle,message);
- }
-
- static String debugObjectStr(Object obj)
- {
- if (obj==null) return("null");
- return(obj.toString());
- }
-
- static String debugTypeStr(int dataType)
- {
- if (JdbcDebugCfg.traceActive)
- {
- switch (dataType)
- {
- case java.sql.Types.ARRAY:
- return("ARRAY");
- case java.sql.Types.BIGINT:
- return("BIGINT");
- case java.sql.Types.BINARY:
- return("BINARY");
- case java.sql.Types.BIT:
- return("BIT");
- case java.sql.Types.BLOB:
- return("BLOB");
- case java.sql.Types.BOOLEAN:
- return("BOOLEAN");
- case java.sql.Types.CHAR:
- return("CHAR");
- case java.sql.Types.CLOB:
- return("CLOB");
- case java.sql.Types.DATALINK:
- return("DATALINK");
- case java.sql.Types.DATE:
- return("DATE");
- case java.sql.Types.DECIMAL:
- return("DECIMAL");
- case java.sql.Types.DISTINCT:
- return("DISTINCT");
- case java.sql.Types.DOUBLE:
- return("DOUBLE");
- case java.sql.Types.FLOAT:
- return("FLOAT");
- case java.sql.Types.INTEGER:
- return("INTEGER");
- case java.sql.Types.JAVA_OBJECT:
- return("JAVA_OBJECT");
- case java.sql.Types.LONGVARBINARY:
- return("LONGVARBINARY");
- case java.sql.Types.LONGVARCHAR:
- return("LONGVARCHAR");
- case java.sql.Types.NULL:
- return("NULL");
- case java.sql.Types.NUMERIC:
- return("NUMERIC");
- case java.sql.Types.OTHER:
- return("OTHER");
- case java.sql.Types.REAL:
- return("REAL");
- case java.sql.Types.REF:
- return("REF");
- case java.sql.Types.SMALLINT:
- return("SMALLINT");
- case java.sql.Types.STRUCT:
- return("STRUCT");
- case java.sql.Types.TIME:
- return("TIME");
- case java.sql.Types.TIMESTAMP:
- return("TIMESTAMP");
- case java.sql.Types.TINYINT:
- return("TINYINT");
- case java.sql.Types.VARBINARY:
- return("VARBINARY");
- case java.sql.Types.VARCHAR:
- return("VARCHAR");
- }
- return("Unknown (" + Integer.toString(dataType) + ")");
- }
- return null;
- }
-
- native static private long getDebugHandle(long method_name_handle);
- native static private long getMethodNameHandle(String method_name);
- native static private void methodEntry(long handle, int debug_level, long method_name_handle);
- native static private void methodReturn(long handle, String message);
- native static private void methodExit(long handle);
- native static private void traceOut(long handle, int debug_level, String message);
-
- static
- {
- System.loadLibrary("jdbcT2");
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51a83dc2/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebugCfg.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebugCfg.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebugCfg.java
deleted file mode 100644
index bd0eb88..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/JdbcDebugCfg.java
+++ /dev/null
@@ -1,28 +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 @@@
-
-// Java tracing is always disabled in this build environment
-package org.trafodion.jdbc.t2;
-class JdbcDebugCfg
-{
- static final boolean entryActive = false;
- static final boolean traceActive = false;
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51a83dc2/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Messages.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Messages.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Messages.java
deleted file mode 100644
index a8e95a4..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/Messages.java
+++ /dev/null
@@ -1,217 +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 @@@
-
-/* -*-java-*-
- * Filename : Messages.java
- */
-
-package org.trafodion.jdbc.t2;
-
-import java.sql.*;
-import java.util.MissingResourceException;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-import java.text.MessageFormat;
-
-
-class Messages
-{
- static SQLException createSQLException(Locale msgLocale, String messageId, Object[] messageArguments)
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_createSQLException].methodEntry();
- try
- {
- Locale currentLocale;
- int sqlcode;
-
- if (msgLocale == null)
- currentLocale = Locale.getDefault();
- else
- currentLocale = msgLocale;
- try
- {
- PropertyResourceBundle messageBundle =
- (PropertyResourceBundle) ResourceBundle.getBundle("SQLMXT2Messages", currentLocale);//R321 changed property file name to SQLMXT2Messages_en.properties
- 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 SQLException(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(",");
- }
- }
- return new SQLException(message, "HY000", -1);
- }
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_createSQLException].methodExit();
- }
- }
-
- static SQLWarning createSQLWarning(Locale msgLocale, String messageId, Object[] messageArguments)
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_createSQLWarning].methodEntry();
- try
- {
- Locale currentLocale;
- int sqlcode;
-
- if (msgLocale == null)
- currentLocale = Locale.getDefault();
- else
- currentLocale = msgLocale;
- try
- {
- PropertyResourceBundle messageBundle =
- (PropertyResourceBundle) ResourceBundle.getBundle("SQLMXT2Messages", currentLocale);//R321 changed property file name to SQLMXT2Messages_en.properties
- 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)
- {
- sqlcode = 1;
- }
- }
- else
- sqlcode = 1;
- return 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(",");
- }
- }
- return new SQLWarning(message, "01000", 1);
- }
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_createSQLWarning].methodExit();
- }
- }
-
- static void throwUnsupportedFeatureException(Locale locale, String s) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_throwUnsupportedFeatureException].methodEntry();
- try
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = s;
- throw Messages.createSQLException(locale, "unsupported_feature", messageArguments);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_throwUnsupportedFeatureException].methodExit();
- }
- }
- static void throwDeprecatedMethodException(Locale locale, String s) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_throwDeprecatedMethodException].methodEntry();
- try
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = s;
- throw Messages.createSQLException(locale, "deprecated_method", messageArguments);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_throwDeprecatedMethodException].methodExit();
- }
- }
-
- private static int methodId_createSQLException = 0;
- private static int methodId_createSQLWarning = 1;
- private static int methodId_throwUnsupportedFeatureException = 2;
- private static int methodId_throwDeprecatedMethodException = 3;
- private static int totalMethodIds = 4;
- private static JdbcDebug[] debug;
-
- static
- {
- String className = "Messages";
- if (JdbcDebugCfg.entryActive)
- {
- debug = new JdbcDebug[totalMethodIds];
- debug[methodId_createSQLException] = new JdbcDebug(className,"createSQLException");
- debug[methodId_createSQLWarning] = new JdbcDebug(className,"createSQLWarning");
- debug[methodId_throwUnsupportedFeatureException] = new JdbcDebug(className,"throwUnsupportedFeatureException");
- debug[methodId_throwDeprecatedMethodException] = new JdbcDebug(className,"throwDeprecatedMethodException");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51a83dc2/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/PreparedStatementManager.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/PreparedStatementManager.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/PreparedStatementManager.java
deleted file mode 100644
index ce746ba..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/PreparedStatementManager.java
+++ /dev/null
@@ -1,569 +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 @@@
-
-/*
- * Filename : PreparedStatementManager.java
- */
-
- /*
- * Method Changed : addPreparedStatement & getPreparedStatement
- */
-package org.trafodion.jdbc.t2;
-
-import java.sql.*;
-import javax.sql.*;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Properties;
-import java.util.Iterator;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Date;
-
-class PreparedStatementManager extends SQLMXHandle {
-
- boolean isStatementCachingEnabled() {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_isStatementCachingEnabled].methodEntry();
- try {
- if (maxStatements_ < 1)
- return false;
- else
- return true;
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_isStatementCachingEnabled].methodExit();
- }
- }
-
- boolean makeRoom() throws SQLException {
-
- if (JdbcDebugCfg.entryActive)
- debug[methodId_makeRoom].methodEntry();
- try {
- if (out_ != null) {
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL))
- out_.println(getTraceId() + "makeRoom() - maxStatements = "
- + maxStatements_);
- }
- Iterator i;
- SQLMXPreparedStatement pStmt;
- CachedPreparedStatement cs;
- long oldest = 0;
- long stmtTime;
- String key = null;
-
- i = (prepStmtsInCache_.values()).iterator();
- List<CachedPreparedStatement> listOfNotInUse = new ArrayList<CachedPreparedStatement>();
-
- // Get the all cached statement that is not in use
- for (; i.hasNext();) {
- cs = (CachedPreparedStatement) i.next();
- if (!cs.inUse_) {
- oldest = cs.getLastUsedTime();
- key = cs.getLookUpKey();
- if (out_ != null) {
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL))
- out_.println(getTraceId() + "makeroom() "
- + "Found unused cached statement - " + "\""
- + key + "\"");
- }
- listOfNotInUse.add(cs);
- }
- }
-
- // Try to remove the oldest/unused statement only if found one above
- if (!listOfNotInUse.isEmpty()) {
- Collections.sort(listOfNotInUse);
- CachedPreparedStatement csForRemoval = listOfNotInUse.get(0);
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL)) {
- out_.println(getTraceId() + "makeroom() "
- + "Found older unused cached statement - " + "\""
- + csForRemoval.getLookUpKey() + "\"");
- }
- prepStmtsInCache_.remove(csForRemoval.getLookUpKey());
- ((SQLMXPreparedStatement) csForRemoval.getPreparedStatement())
- .close(true);
- count_--;
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL)) {
- out_.println(getTraceId() + "makeroom() "
- + "Removed cached stmt - " + "\""
- + csForRemoval.getLookUpKey() + "\"");
- }
- listOfNotInUse.clear();
- return true;
- }
- return false;
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_makeRoom].methodExit();
- }
- }
-
- void closePreparedStatementsAll() throws SQLException {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_closePreparedStatementsAll].methodEntry();
- try {
- if (out_ != null) {
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL))
- out_.println(getTraceId() + "closePreparedStatementsAll()");
- }
-
- Object[] csArray;
-
- CachedPreparedStatement cs;
- int i = 0;
-
- csArray = (prepStmtsInCache_.values()).toArray();
- for (i = 0; i < csArray.length; i++) {
- cs = (CachedPreparedStatement) csArray[i];
- if (cs != null){
- cs.close(false);
- }
- }
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_closePreparedStatementsAll].methodExit();
- }
- }
-
- /*
- * Description : Identify and close the duplicate statement. Additional
- * argument origPStmt introduced.
- */
- // void closePreparedStatement(SQLMXConnection connect,
- void closePreparedStatement(SQLMXPreparedStatement origPStmt,
- SQLMXConnection connect, String sql, int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException {
-
- if (JdbcDebugCfg.entryActive)
- debug[methodId_closePreparedStatement].methodEntry();
- try {
- if (out_ != null) {
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL))
- out_.println(getTraceId() + "closePreparedStatement(" + connect
- + ",\"" + sql + "\"," + resultSetType + ","
- + resultSetConcurrency + "," + resultSetHoldability
- + ")");
- }
- SQLMXPreparedStatement pStmt = null;
- CachedPreparedStatement cs = null;
- ;
- String lookupKey;
-
- Object csArray[];
-// lookupKey = sql;
-// if (connect.catalog_ != null)
-// lookupKey = lookupKey.concat(connect.catalog_);
-// if (connect.schema_ != null)
-// lookupKey = lookupKey.concat(connect.schema_);
-// lookupKey = lookupKey.concat(String.valueOf(connect.transactionIsolation_))
-// .concat(String.valueOf(resultSetHoldability));
-// if (connect.getMD5HashCode() != null)
-// lookupKey = lookupKey.concat(connect.getMD5HashCode());
-//
-
-// lookupKey = sql;
-// if (connect.catalog_ != null)
-// lookupKey.concat(connect.catalog_);
-// if (connect.schema_ != null)
-// lookupKey.concat(connect.schema_);
-// lookupKey.concat(String.valueOf(connect.transactionIsolation_))
-// .concat(String.valueOf(resultSetHoldability));
-
-
-// cs = (CachedPreparedStatement) prepStmtsInCache_.get(lookupKey);
-
- csArray = (prepStmtsInCache_.values()).toArray();
- boolean foundFlag = false;
-
- for(int i=0;i<csArray.length;i++){
- cs = (CachedPreparedStatement)csArray[i];
-
- if(cs != null){
- pStmt = (SQLMXPreparedStatement) cs.getPreparedStatement();
- if (pStmt == origPStmt){
- cs.inUse_ = false;
- cs.setLastUsedInfo();
- foundFlag=true;
- break;
-// origPStmt.close(true);
- }
- }
- }
-
- if(!foundFlag){
- origPStmt.close(true);
- if (out_ != null) {
- if (traceFlag_ >= 1)
- out_.println(getTraceId() + "closePreparedStatement()["
- +origPStmt.getStmtLabel()+ "]: Hard closed duplicate statement - " + "\""
- + origPStmt + "\"");
- }
- }
-
- /*
- * Description : Identify and close the duplicate statement.
- */
-// if (cs != null) {
-// pStmt = (SQLMXPreparedStatement) cs.getPreparedStatement();
-// if (pStmt != origPStmt)
-// cs = null;
-//
-// }
-//
-// if (cs == null) {
-// origPStmt.close(true);
-// if (out_ != null) {
-// if (traceFlag_ >= 1)
-// out_.println(getTraceId() + "closePreparedStatement() "
-// + "Hard closed duplicate statement - " + "\""
-// + lookupKey + "\"");
-// }
-// }
-// // If the number of cached statements exceeds maxStatements,
-// // perform a hard close
-// if (cs != null) {
-// if (count_ > maxStatements_) {
-// // Remove it from cache
-// cs = (CachedPreparedStatement) prepStmtsInCache_
-// .remove(lookupKey);
-// pStmt = (SQLMXPreparedStatement) cs.getPreparedStatement();
-// pStmt.close(true);
-// count_--;
-// if (out_ != null) {
-// if ((traceFlag_ == T2Driver.POOLING_LVL)
-// || (traceFlag_ == T2Driver.ENTRY_LVL))
-// out_.println(getTraceId() + "closePreparedStatement() "
-// + "Hard closed cached statement - " + "\""
-// + lookupKey + "\"");
-// }
-// } else {
-// cs.inUse_ = false;
-// cs.setLastUsedInfo();
-// if (out_ != null) {
-// if ((traceFlag_ == T2Driver.POOLING_LVL)
-// || (traceFlag_ == T2Driver.ENTRY_LVL))
-// out_.println(getTraceId() + "closePreparedStatement() "
-// + "Logical closed cached statement - "
-// + "\"" + lookupKey + "\"");
-// }
-// }
-// }
-// return;
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_closePreparedStatement].methodExit();
- }
- }
-
- void clearPreparedStatementsAll() {
-
- if (JdbcDebugCfg.entryActive)
- debug[methodId_clearPreparedStatementsAll].methodEntry();
- try {
- if (out_ != null) {
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL))
- out_.println(getTraceId() + "clearPreparedStatementsAll()");
- }
- if (prepStmtsInCache_ != null)
- prepStmtsInCache_.clear();
- count_ = 0;
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_clearPreparedStatementsAll].methodExit();
- }
- }
-
- void addPreparedStatement(SQLMXConnection connect, String sql,
- PreparedStatement pStmt, int resultSetType,
- int resultSetConcurrency, int resultSetHoldability)
- throws SQLException {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_addPreparedStatement].methodEntry();
- if (out_ != null) {
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL))
- out_.println(getTraceId() + "addPreparedStatement(" + connect
- + ",\"" + sql + "\"," + pStmt + "," + resultSetType
- + "," + resultSetConcurrency + ","
- + resultSetHoldability + ")");
- }
-
- try {
- CachedPreparedStatement cachedStmt;
- String lookupKey;
- lookupKey = sql;
- if (connect.catalog_ != null)
- lookupKey = lookupKey.concat(connect.catalog_);
- if (connect.schema_ != null)
- lookupKey = lookupKey.concat(connect.schema_);
- lookupKey = lookupKey.concat(String.valueOf(connect.transactionIsolation_))
- .concat(String.valueOf(resultSetHoldability));
- if (connect.getMD5HashCode() != null)
- lookupKey = lookupKey.concat(connect.getMD5HashCode());
-// lookupKey = sql;
-// if (connect.catalog_ != null)
-// lookupKey.concat(connect.catalog_);
-// if (connect.schema_ != null)
-// lookupKey.concat(connect.schema_);
-// lookupKey.concat(String.valueOf(connect.transactionIsolation_))
-// .concat(String.valueOf(resultSetHoldability));
-
- boolean hasRoom = true;
- if (count_ >= maxStatements_) {
- hasRoom = makeRoom();
- if (!hasRoom) {
- // Cached statement count has reached maxStatements AND they
- // are all in use
- Object[] warnMsg = new Object[1];
- warnMsg[0] = new Integer(maxStatements_);
- // Set a warning indicating maxStatements have been exceeded
- connect.setSQLWarning(connect.locale_,
- "exceeded_maxStatements", warnMsg);
- return;
- }
- }
- if (count_ < maxStatements_ || hasRoom) {
- if (!prepStmtsInCache_.containsKey(lookupKey)) {
- cachedStmt = new CachedPreparedStatement(pStmt, lookupKey);
- prepStmtsInCache_.put(lookupKey, cachedStmt);
- count_++;
- if (out_ != null
- && ((traceFlag_ == T2Driver.POOLING_LVL) || (traceFlag_ == T2Driver.ENTRY_LVL))) {
- //R3.2 changes -- start
- out_.println(getTraceId()
- + "addPreparedStatement() Added stmt to cache "
- + "\"" + cachedStmt.getPstmt_().stmtId_ + "\" ; "
- + "cached stmt cnt = " + count_);
- //R3.2 changes -- end
- }
- }
- }
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_addPreparedStatement].methodExit();
- }
-
- }
-
- PreparedStatement getPreparedStatement(SQLMXConnection connect, String sql,
- int resultSetType, int resultSetConcurrency,
- int resultSetHoldability) throws SQLException {
-
- if (JdbcDebugCfg.entryActive)
- debug[methodId_getPreparedStatement].methodEntry();
- try {
- if (out_ != null) {
- if ((traceFlag_ == T2Driver.POOLING_LVL)
- || (traceFlag_ == T2Driver.ENTRY_LVL))
- out_.println(getTraceId() + "getPreparedStatement(" + connect
- + ",\"" + sql + "\"," + resultSetType + ","
- + resultSetConcurrency + "," + resultSetHoldability
- + ")");
- }
-
- PreparedStatement pStmt = null;
- CachedPreparedStatement cachedStmt;
- String lookupKey;
-
- lookupKey = sql;
- if (connect.catalog_ != null)
- lookupKey = lookupKey.concat(connect.catalog_);
- if (connect.schema_ != null)
- lookupKey = lookupKey.concat(connect.schema_);
- lookupKey = lookupKey.concat(String.valueOf(connect.transactionIsolation_))
- .concat(String.valueOf(resultSetHoldability));
- if (connect.getMD5HashCode() != null)
- lookupKey = lookupKey.concat(connect.getMD5HashCode());
-// lookupKey = sql;
-// if (connect.catalog_ != null)
-// lookupKey.concat(connect.catalog_);
-// if (connect.schema_ != null)
-// lookupKey.concat(connect.schema_);
-// lookupKey.concat(String.valueOf(connect.transactionIsolation_))
-// .concat(String.valueOf(resultSetHoldability));
-
- if (prepStmtsInCache_ != null) {
- cachedStmt = (CachedPreparedStatement) prepStmtsInCache_
- .get(lookupKey);
- if (cachedStmt != null) {
- if (!cachedStmt.inUse_) {
- pStmt = cachedStmt.getPreparedStatement();
- ((org.trafodion.jdbc.t2.SQLMXPreparedStatement) pStmt)
- .reuse(connect, resultSetType,
- resultSetConcurrency,
- resultSetHoldability);
- cachedStmt.inUse_ = true;
- cachedStmt.setLastUsedInfo();
- } else
- pStmt = null;
- }
- }
- return pStmt;
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_getPreparedStatement].methodExit();
- }
- }
-
- void setLogInfo(int traceFlag, PrintWriter out) {
-
- if (JdbcDebugCfg.entryActive)
- debug[methodId_setLogInfo].methodEntry();
- try {
- traceFlag_ = traceFlag;
- out_ = out;
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_setLogInfo].methodExit();
- }
- }
-
- PreparedStatementManager() {
- super();
- if (JdbcDebugCfg.entryActive)
- debug[methodId_PreparedStatementManager_V].methodEntry();
- try {
- String className = getClass().getName();
-
- // Build up template portion of jdbcTrace output. Pre-appended to
- // jdbcTrace entries.
- // jdbcTrace:[XXXX]:[Thread[X,X,X]]:[XXXXXXXX]:ClassName.
- setTraceId(T2Driver.traceText
- + T2Driver.dateFormat.format(new Date())
- + "]:["
- + Thread.currentThread()
- + "]:["
- + hashCode()
- + "]:"
- + className.substring(T2Driver.REMOVE_PKG_NAME,
- className.length()) + ".");
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_PreparedStatementManager_V].methodExit();
- }
- }
-
- PreparedStatementManager(T2Properties info) {
- super();
- if (JdbcDebugCfg.entryActive)
- debug[methodId_PreparedStatementManager_L].methodEntry();
- try {
-
-
-// String tmp;
-
- if (info != null) {
-// tmp = info.getProperty("maxStatements");
- maxStatements_ = info.getMaxStatements();
-// if (tmp != null)
-// maxStatements_ = Integer.parseInt(tmp);
- if (maxStatements_ < 1)
- maxStatements_ = 0;
- }
- if (maxStatements_ > 0) {
- prepStmtsInCache_ = new HashMap<String, CachedPreparedStatement>();
- }
-
- // Build up template portion of jdbcTrace output. Pre-appended to
- // jdbcTrace entries.
- // jdbcTrace:[XXXX]:[Thread[X,X,X]]:[XXXXXXXX]:ClassName.
-
- } finally {
- if (JdbcDebugCfg.entryActive)
- debug[methodId_PreparedStatementManager_L].methodExit();
- }
- }
- public void setTraceId(String traceId_) {
- this.traceId_ = traceId_;
- }
-
- public String getTraceId() {
- String className = getClass().getName();
- setTraceId(T2Driver.traceText
- + T2Driver.dateFormat.format(new Date())
- + "]:["
- + Thread.currentThread()
- + "]:["
- + this.toString()
- + "]:"
- + className.substring(T2Driver.REMOVE_PKG_NAME,
- className.length()) + ".");
- return traceId_;
- }
- protected HashMap<String, CachedPreparedStatement> prepStmtsInCache_;
- private int maxStatements_;
- private int count_;
-
- int traceFlag_;
- PrintWriter out_;
- private String traceId_;
-
- private static int methodId_isStatementCachingEnabled = 0;
- private static int methodId_makeRoom = 1;
- private static int methodId_closePreparedStatementsAll = 2;
- private static int methodId_closePreparedStatement = 3;
- private static int methodId_clearPreparedStatementsAll = 4;
- private static int methodId_addPreparedStatement = 5;
- private static int methodId_getPreparedStatement = 6;
- private static int methodId_setLogInfo = 7;
- private static int methodId_PreparedStatementManager_V = 8;
- private static int methodId_PreparedStatementManager_L = 9;
- private static int totalMethodIds = 10;
- private static JdbcDebug[] debug;
-
- static {
- String className = "PreparedStatementManager";
- if (JdbcDebugCfg.entryActive) {
- debug = new JdbcDebug[totalMethodIds];
- debug[methodId_isStatementCachingEnabled] = new JdbcDebug(
- className, "isStatementCachingEnabled");
- debug[methodId_makeRoom] = new JdbcDebug(className, "makeRoom");
- debug[methodId_closePreparedStatementsAll] = new JdbcDebug(
- className, "closePreparedStatementsAll");
- debug[methodId_closePreparedStatement] = new JdbcDebug(className,
- "closePreparedStatement");
- debug[methodId_clearPreparedStatementsAll] = new JdbcDebug(
- className, "clearPreparedStatementsAll");
- debug[methodId_addPreparedStatement] = new JdbcDebug(className,
- "addPreparedStatement");
- debug[methodId_getPreparedStatement] = new JdbcDebug(className,
- "getPreparedStatement");
- debug[methodId_setLogInfo] = new JdbcDebug(className, "setLogInfo");
- debug[methodId_PreparedStatementManager_V] = new JdbcDebug(
- className, "PreparedStatementManager_V");
- debug[methodId_PreparedStatementManager_L] = new JdbcDebug(
- className, "PreparedStatementManager_L");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51a83dc2/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/ResultSetInfo.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/ResultSetInfo.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/ResultSetInfo.java
deleted file mode 100644
index 727ff1c..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/ResultSetInfo.java
+++ /dev/null
@@ -1,51 +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 @@@
-
-/*
- * Filename : ResultSetInfo.java
- */
-
-package org.trafodion.jdbc.t2;
-
-import java.sql.Connection;
-
-public class ResultSetInfo
-{
- public static long getVersion()
- {
- return CLASS_VERSION;
- }
-
- public boolean LOBDataDetected;
- public Connection connection;
- public int ctxHandle;
- public int stmtID;
- public int firstBufferedRow;
- public int lastBufferedRow;
- public int currentRowPosition;
- public int cursorType;
- public long RSCounter;
- public boolean RSClosed;
- public boolean stmtClosed; //To maintain CLI Statement Closure Status.
-
- private static final long CLASS_VERSION = 1;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/51a83dc2/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/SQLMXBlob.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/SQLMXBlob.java b/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/SQLMXBlob.java
deleted file mode 100644
index 66dad42..0000000
--- a/core/conn/jdbc_type2/src/main/java/org/trafodion/jdbc/t2/SQLMXBlob.java
+++ /dev/null
@@ -1,905 +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 @@@
-
-/* -*-java-*-
- * Filename : SQLMXBlob.java
- * Description : This program implements the java.sql.Blob interface
- *
- */
-
-package org.trafodion.jdbc.t2;
-
-import java.sql.*;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Date;
-import java.io.PrintWriter;
-
-public class SQLMXBlob extends SQLMXLob implements Blob
-{
- public InputStream getBinaryStream() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getBinaryStream].methodEntry();
- try
- {
- checkIfCurrent();
- return getInputStream();
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getBinaryStream].methodExit();
- }
- }
-
-
- public byte[] getBytes(long pos, int length) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getBytes].methodEntry();
- try
- {
- int startChunkNo;
- int endChunkNo;
- int offset;
- int copyLen;
- int copyOffset;
- int dataLength;
- int readLen;
- long blobDataLen;
- byte[] data;
- byte[] b;
- byte[] b1;
-
- if (pos <= 0 || length < 0 )
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = "Blob.getBytes(long, int): position is less than or equal to 0, or length is less than 0";
- throw Messages.createSQLException(conn_.locale_,"invalid_input_value", messageArguments);
- }
-
- // Blob data total length must be larger than pos supplied (used to offset the bytes)
- blobDataLen = length();
- if (pos > blobDataLen)
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = "Blob.getBytes(long, int): position (" + pos + ") exceeds the Blob data length (" + blobDataLen + ")";
- throw Messages.createSQLException(conn_.locale_,"invalid_input_value", messageArguments);
- }
-
- checkIfCurrent();
- startChunkNo = (int)((pos-1) / chunkSize_);
- endChunkNo = (int)((pos-1+length)/ chunkSize_);
- copyLen = length;
- offset = (int)((pos-1) % chunkSize_);
- copyOffset= 0;
- readLen = 0;
- b = new byte[length];
- prepareGetLobDataStmt();
-
- if ((traceWriter_ != null) &&
- ((traceFlag_ == T2Driver.LOB_LVL) || (traceFlag_ == T2Driver.ENTRY_LVL)))
- {
- traceWriter_.println(getTraceId()
- + "getBytes(" + pos + "," + length + ") - GetLobDataStmt params: tableName_=" + tableName_
- + " dataLocator_=" + dataLocator_
- + " startChunkNo=" + startChunkNo
- + " endChunkNo=" + endChunkNo);
- }
-
- synchronized (conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT])
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setString(1, tableName_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setLong(2, dataLocator_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setInt(3, startChunkNo);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setInt(4, endChunkNo);
- ResultSet rs = conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].executeQuery();
- try
- {
- while (rs.next())
- {
- data = rs.getBytes(1);
- dataLength = data.length-offset;
-
- if (dataLength >= copyLen)
- {
- System.arraycopy(data, offset, b, copyOffset, copyLen);
- readLen += copyLen;
- break;
- }
- else
- {
- System.arraycopy(data, offset, b, copyOffset, dataLength);
- copyLen -= dataLength;
- copyOffset += dataLength;
- readLen += dataLength;
- }
- offset = 0; // reset the offset
- }
- }
- finally
- {
- rs.close();
- }
- }
- if (readLen == length)
- return b;
- else
- {
- b1 = new byte[readLen];
- System.arraycopy(b, 0, b1, 0, readLen);
- return b1;
- }
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getBytes].methodExit();
- }
- }
-
- public long position(Blob pattern, long start) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_position_LJ].methodEntry();
- try
- {
- byte[] searchPattern;
-
- if (start <= 0 )
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = "Blob.position(Blob, long)";
- throw Messages.createSQLException(conn_.locale_,"invalid_input_value", messageArguments);
- }
- checkIfCurrent();
- searchPattern = pattern.getBytes(1L,(int)pattern.length());
- return position(searchPattern, start);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_position_LJ].methodExit();
- }
- }
-
- public long position(byte[] pattern, long start) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_position_BJ].methodEntry();
- try
- {
- byte[] blobData;
- long retValue;
-
- if (start <= 0 )
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = "Blob.position(byte[], long)";
- throw Messages.createSQLException(conn_.locale_,"invalid_input_value", messageArguments);
- }
- checkIfCurrent();
- blobData = getBytes(start, (int)length());
- retValue = findBytes(blobData, 0, blobData.length, pattern);
- if (retValue != -1)
- retValue += start;
-
- return retValue;
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_position_BJ].methodExit();
- }
- }
-
-
- public OutputStream setBinaryStream(long pos) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_setBinaryStream].methodEntry();
- try
- {
- // Check if Autocommit is set, and no external transaction exists
- checkAutoCommitExtTxn();
- checkIfCurrent();
- return setOutputStream(pos);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_setBinaryStream].methodExit();
- }
- }
-
- public int setBytes(long pos, byte[] bytes) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_setBytes_JB].methodEntry();
- try
- {
- if (bytes == null)
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = "Blob.setBytes(long, byte[])";
- throw Messages.createSQLException(conn_.locale_,"invalid_input_value", messageArguments);
- }
- return setBytes(pos, bytes, 0, bytes.length);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_setBytes_JB].methodExit();
- }
- }
-
- public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_setBytes_JBII].methodEntry();
- try
- {
- int endChunkNo;
- int updOffset;
- int updLen;
- int chunkNo;
- long lobLenForUpd;
- int byteOffset;
- int retLen;
- int totalRetLen;
- int copyLen;
- long remLen;
- long lobLen;
-
- byte [] tempChunk = null;
-
- if (pos <= 0 || len < 0 || offset < 0 || bytes == null)
- {
- Object[] messageArguments = new Object[1];
- messageArguments[0] = "Blob.setBytes(long, byte[], int, int)";
- throw Messages.createSQLException(conn_.locale_,"invalid_input_value", messageArguments);
- }
- checkIfCurrent();
- lobLen = length();
- if (pos > lobLen+1)
- throw Messages.createSQLException(conn_.locale_,"invalid_position_value", null);
- copyLen = len;
- remLen = pos-1+len; // Length to be either updated or inserted
- byteOffset = offset;
- totalRetLen = 0;
- chunkNo = (int)((pos-1)/ chunkSize_);
- // calculate the length that can be updated rounded to chunk size
- if ((lobLen % chunkSize_) == 0)
- lobLenForUpd = (lobLen / chunkSize_) * chunkSize_;
- else
- lobLenForUpd = ((lobLen / chunkSize_)+1) * chunkSize_;
- if (remLen <= lobLenForUpd)
- updLen = len;
- else
- updLen = (int)(lobLenForUpd - (pos-1));
- if (updLen > 0)
- {
- updOffset = (int)((pos-1) % chunkSize_);
- prepareUpdLobDataStmt();
-
- synchronized (conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT])
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setString(4, tableName_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setLong(5, dataLocator_);
-
- while (true)
- {
- // String is 0 based while substring in SQL/MX is 1 based, hence +1
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setInt(6, chunkNo);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setInt(1, updOffset);
- if ((updOffset + updLen) <= chunkSize_)
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setInt(3, updOffset + updLen + 1);
- if ((byteOffset == 0) && (updLen - updOffset == bytes.length))
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setBytes(2, bytes);
- }
- else
- {
- tempChunk = new byte[updLen];
- System.arraycopy(bytes, byteOffset, tempChunk, 0, updLen);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setBytes(2, tempChunk);
- }
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].executeUpdate();
- totalRetLen += updLen;
- byteOffset += updLen;
- chunkNo++;
- break;
- }
- else
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setInt(3, chunkSize_+1);
- if (tempChunk == null || tempChunk.length != chunkSize_-updOffset)
- tempChunk = new byte[chunkSize_-updOffset];
- System.arraycopy(bytes, byteOffset, tempChunk, 0, chunkSize_-updOffset);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].setBytes(2, tempChunk);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT].executeUpdate();
- totalRetLen += (chunkSize_-updOffset);
- byteOffset += (chunkSize_-updOffset);
- updLen -= (chunkSize_-updOffset);
- chunkNo++;
- }
- updOffset = 0;
- }
- }
- copyLen = (int)(remLen - lobLenForUpd);
-
- if ((traceWriter_ != null) &&
- ((traceFlag_ == T2Driver.LOB_LVL) || (traceFlag_ == T2Driver.ENTRY_LVL)))
- {
- traceWriter_.println(getTraceId()
- + "setBytes(" + pos + ",<bytes>," + offset + "," + len
- + ") - UpdLobDataStmt params: tableName_=" + tableName_
- + " dataLocator_=" + dataLocator_ + " chunkNo=" + chunkNo
- + " updOffset=" + updOffset + " updLen=" + updLen
- + " remLen=" + remLen + " lobLenForUpd=" + lobLenForUpd
- + " byteOffset=" + byteOffset + " totalRetLen=" + totalRetLen);
- }
- }
-
- tempChunk = null;
- if (remLen > lobLenForUpd)
- {
- while (true)
- {
- prepareInsLobDataStmt();
-
- synchronized (conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT])
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setString(1, tableName_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setLong(2, dataLocator_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setInt(3, chunkNo);
- if (copyLen <= chunkSize_)
- {
- if (byteOffset == 0 && copyLen == bytes.length)
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setBytes(4, bytes);
- else
- {
- tempChunk = new byte[copyLen];
- System.arraycopy(bytes, byteOffset, tempChunk, 0, copyLen);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setBytes(4, tempChunk);
- }
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].executeUpdate();
- totalRetLen += copyLen;
- break;
- }
- else
- {
- if (tempChunk == null)
- tempChunk = new byte[chunkSize_];
- System.arraycopy(bytes, byteOffset, tempChunk, 0, chunkSize_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setBytes(4, tempChunk);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].executeUpdate();
- byteOffset += chunkSize_;
- copyLen -= chunkSize_;
- totalRetLen += chunkSize_;
- }
- chunkNo++;
- }
- }
-
- if ((traceWriter_ != null) &&
- ((traceFlag_ == T2Driver.LOB_LVL) || (traceFlag_ == T2Driver.ENTRY_LVL)))
- {
- traceWriter_.println(getTraceId()
- + "setBytes(" + pos + ",<bytes>," + offset + "," + len
- + ") - InsLobDataStmt params: tableName_=" + tableName_
- + " dataLocator_=" + dataLocator_ + " (total)chunkNo=" + chunkNo
- + " copyLen=" + copyLen + " byteOffset=" + byteOffset
- + " totalRetLen=" + totalRetLen);
- }
- }
- return totalRetLen;
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_setBytes_JBII].methodExit();
- }
- }
-
- // This function populates the Blob data from one of the following:
- // 1. InputStream set in PreparedStatement.setBinaryStream
- // 2. From another clob set in PreparedStatement.setBlob or ResultSet.updateBlob
- // This function is called at the time of PreparedStatement.executeUpdate, execute and
- // executeBatch
-
- void populate() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_populate].methodEntry();
- try
- {
- SQLMXLobOutputStream os;
-
- if (is_ != null)
- {
- os = (SQLMXLobOutputStream)setOutputStream(1);
- os.populate(is_, isLength_);
- is_ = null;
- }
- else if (inputLob_ != null)
- {
- populateFromBlob();
- inputLob_ = null;
- }
- else if (b_ != null)
- {
- setBytes(1, b_);
- b_ = null;
- }
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_populate].methodExit();
- }
- }
-
- void populateFromBlob() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_populateFromBlob].methodEntry();
- try
- {
- long pos;
- byte[] b;
- int ret;
- ResultSet rs;
- SQLMXBlob inputBlob;
- int chunkNo = 0;
-
- pos = 1;
- if (inputLob_ instanceof SQLMXBlob)
- {
- // When SQL/MX supports insert into a table by selecting some other rows in
- // the same table, we should change the code to do so
- // Until then, we read a row and write to the same table with different
- // data locator till all the rows are read
- inputBlob = (SQLMXBlob)inputLob_;
-
- prepareGetLobDataStmt();
- prepareInsLobDataStmt();
-
- if ((traceWriter_ != null) &&
- ((traceFlag_ == T2Driver.LOB_LVL) || (traceFlag_ == T2Driver.ENTRY_LVL)))
- {
- traceWriter_.println(getTraceId()
- + "populateFromBlob() - GetLobDataStmt params: tableName_=" + inputBlob.tableName_
- + " dataLocator_=" + inputBlob.dataLocator_ + " chunkNo=0");
- }
-
- synchronized (conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT])
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setString(1, inputBlob.tableName_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setLong(2, inputBlob.dataLocator_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setInt(3, 0); // start ChunkNo
- conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].setInt(4, Integer.MAX_VALUE);
- rs = conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT].executeQuery();
- try
- {
- synchronized(conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT])
- {
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setString(1, tableName_);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setLong(2, dataLocator_);
-
- while (rs.next())
- {
- b = rs.getBytes(1);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setInt(3, chunkNo);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].setBytes(4, b);
- conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT].executeUpdate();
- chunkNo++;
- }
- }
-
- if ((traceWriter_ != null) &&
- ((traceFlag_ == T2Driver.LOB_LVL) || (traceFlag_ == T2Driver.ENTRY_LVL)))
- {
- traceWriter_.println(getTraceId()
- + "populateFromBlob() - InsLobDataStmt params: tableName_=" + tableName_
- + " dataLocator_=" + dataLocator_ + " (total)chunkNo=" + chunkNo);
- }
- }
- finally
- {
- rs.close();
- }
- }
- }
- else
- {
- while (true)
- {
- b = inputLob_.getBytes(pos, chunkSize_);
- if (b.length == 0)
- break;
- ret = setBytes(pos, b);
- pos += b.length;
- }
- }
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_populateFromBlob].methodExit();
- }
- }
-
- static final int findBytes(byte buf[], int off, int len, byte ptrn[])
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_findBytes].methodEntry();
- try
- {
- int buf_len = off + len;
- int ptrn_len = ptrn.length;
- int i; // index into buf
- int j; // index into ptrn;
- byte b = ptrn[0]; // next byte of interest
-
- for (i = off; i < buf_len; )
- {
- j = 0;
- while (i < buf_len && j < ptrn_len && buf[i] == ptrn[j])
- {
- i++;
- j++;
- }
- if (i == buf_len || j == ptrn_len) return i - j;
- else
- {
- // We have to go back a bit as there may be an overlapping
- // match starting a bit later in buf...
- i = i - j + 1;
- }
- }
- return -1;
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_findBytes].methodExit();
- }
- }
-
- // The following methods are used to prepare the LOB statement specific
- // to BLOB objects, and re-prepares if the lobTableName_ has changed.
- void prepareGetLobLenStmt() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareGetLobLenStmt].methodEntry();
- try
- {
- conn_.prepareGetLobLenStmt(lobTableName_,true);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareGetLobLenStmt].methodExit();
- }
- }
-
- void prepareDelLobDataStmt() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareDelLobDataStmt].methodEntry();
- try
- {
- conn_.prepareDelLobDataStmt(lobTableName_,true);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareDelLobDataStmt].methodExit();
- }
- }
-
- void prepareGetLobDataStmt() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareGetLobDataStmt].methodEntry();
- try
- {
- conn_.prepareGetLobDataStmt(lobTableName_,true);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareGetLobDataStmt].methodExit();
- }
- }
-
- void prepareUpdLobDataStmt() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareUpdLobDataStmt].methodEntry();
- try
- {
- conn_.prepareUpdLobDataStmt(lobTableName_,true);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareUpdLobDataStmt].methodExit();
- }
- }
-
- void prepareInsLobDataStmt() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareInsLobDataStmt].methodEntry();
- try
- {
- conn_.prepareInsLobDataStmt(lobTableName_,true);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareInsLobDataStmt].methodExit();
- }
- }
-
- void prepareTrunLobDataStmt() throws SQLException
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareTrunLobDataStmt].methodEntry();
- try
- {
- conn_.prepareTrunLobDataStmt(lobTableName_,true);
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_prepareTrunLobDataStmt].methodExit();
- }
- }
-
- // The following methods are used to return the BLOB prepared statement
- // from the connection object PS array for population and execution.
- PreparedStatement getGetLobLenStmt()
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getGetLobLenStmt].methodEntry();
- try
- {
- return conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_LEN_STMT];
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getGetLobLenStmt].methodExit();
- }
- }
-
- PreparedStatement getDelLobDataStmt()
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getDelLobDataStmt].methodEntry();
- try
- {
- return conn_.LobPrepStmts[SQLMXConnection.BLOB_DEL_LOB_DATA_STMT];
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getDelLobDataStmt].methodExit();
- }
- }
-
- PreparedStatement getTrunLobDataStmt()
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getTrunLobDataStmt].methodEntry();
- try
- {
- return conn_.LobPrepStmts[SQLMXConnection.BLOB_TRUN_LOB_DATA_STMT];
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getTrunLobDataStmt].methodExit();
- }
- }
-
- PreparedStatement getInsLobDataStmt()
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getInsLobDataStmt].methodEntry();
- try
- {
- return conn_.LobPrepStmts[SQLMXConnection.BLOB_INS_LOB_DATA_STMT];
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getInsLobDataStmt].methodExit();
- }
- }
-
- PreparedStatement getUpdLobDataStmt()
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getUpdLobDataStmt].methodEntry();
- try
- {
- return conn_.LobPrepStmts[SQLMXConnection.BLOB_UPD_LOB_DATA_STMT];
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getUpdLobDataStmt].methodExit();
- }
- }
-
- PreparedStatement getGetLobDataStmt()
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getGetLobDataStmt].methodEntry();
- try
- {
- return conn_.LobPrepStmts[SQLMXConnection.BLOB_GET_LOB_DATA_STMT];
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_getGetLobDataStmt].methodExit();
- }
- }
-
-
- // Constructors
- SQLMXBlob(SQLMXConnection connection, String tableName, long dataLocator) throws SQLException
- {
- super(connection, tableName, dataLocator, connection.blobTableName_, true);
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJ].methodEntry();
- try
- {
- if (connection.blobTableName_ == null)
- throw Messages.createSQLException(conn_.locale_,"no_blobTableName", null);
-
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJ].methodExit();
- }
- }
-
- SQLMXBlob(SQLMXConnection connection, String tableName, long dataLocator, InputStream x,
- int length) throws SQLException
- {
- super(connection, tableName, dataLocator, x, length, connection.blobTableName_, true);
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJLI].methodEntry();
- try
- {
- if (connection.blobTableName_ == null)
- throw Messages.createSQLException(conn_.locale_,"no_blobTableName", null);
-
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJLI].methodExit();
- }
- }
-
- SQLMXBlob(SQLMXConnection connection, String tableName, long dataLocator, Blob inputLob) throws SQLException
- {
- super(connection, tableName, dataLocator, connection.blobTableName_, true);
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJL].methodEntry();
- try
- {
- if (connection.blobTableName_ == null)
- throw Messages.createSQLException(conn_.locale_,"no_blobTableName", null);
- inputLob_ = inputLob;
-
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJL].methodExit();
- }
- }
-
- SQLMXBlob(SQLMXConnection connection, String tableName, long dataLocator, byte[] b)
- throws SQLException
- {
- super(connection, tableName, dataLocator, connection.blobTableName_, true);
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJB].methodEntry();
- try
- {
- if (connection.blobTableName_ == null)
- throw Messages.createSQLException(conn_.locale_,"no_blobTableName", null);
- b_ = b;
-
- }
- finally
- {
- if (JdbcDebugCfg.entryActive) debug[methodId_SQLMXBlob_LLJB].methodExit();
- }
- }
- public void setTraceId(String traceId_) {
- this.traceId_ = traceId_;
- }
-
-
- public String getTraceId() {
- traceWriter_ = SQLMXDataSource.traceWriter_;
-
- // Build up template portion of jdbcTrace output. Pre-appended to jdbcTrace entries.
- // jdbcTrace:[XXXX]:[Thread[X,X,X]]:[XXXXXXXX]:ClassName.
- if (traceWriter_ != null)
- {
- traceFlag_ = T2Driver.traceFlag_;
- String className = getClass().getName();
- setTraceId(T2Driver.traceText + T2Driver.dateFormat.format(new Date())
- + "]:[" + Thread.currentThread() + "]:[" + hashCode() + "]:"
- + className.substring(T2Driver.REMOVE_PKG_NAME,className.length())
- + ".");
- }
- return traceId_;
- }
-
- // fields
- private String traceId_;
- static PrintWriter traceWriter_;
- static int traceFlag_;
- Blob inputLob_;
- byte[] b_;
-
- private static int methodId_getBinaryStream = 0;
- private static int methodId_getBytes = 1;
- private static int methodId_position_LJ = 2;
- private static int methodId_position_BJ = 3;
- private static int methodId_setBinaryStream = 4;
- private static int methodId_setBytes_JB = 5;
- private static int methodId_setBytes_JBII = 6;
- private static int methodId_populate = 7;
- private static int methodId_populateFromBlob = 8;
- private static int methodId_findBytes = 9;
- private static int methodId_SQLMXBlob_LLJ = 10;
- private static int methodId_SQLMXBlob_LLJLI = 11;
- private static int methodId_SQLMXBlob_LLJL = 12;
- private static int methodId_SQLMXBlob_LLJB = 13;
- private static int methodId_prepareGetLobLenStmt = 14;
- private static int methodId_prepareDelLobDataStmt = 15;
- private static int methodId_prepareGetLobDataStmt = 16;
- private static int methodId_prepareUpdLobDataStmt = 17;
- private static int methodId_prepareInsLobDataStmt = 18;
- private static int methodId_prepareTrunLobDataStmt = 19;
- private static int methodId_getGetLobLenStmt = 20;
- private static int methodId_getDelLobDataStmt = 21;
- private static int methodId_getTrunLobDataStmt = 22;
- private static int methodId_getInsLobDataStmt = 23;
- private static int methodId_getUpdLobDataStmt = 24;
- private static int methodId_getGetLobDataStmt = 25;
- private static int totalMethodIds = 26;
- private static JdbcDebug[] debug;
-
- static
- {
- String className = "SQLMXBlob";
- if (JdbcDebugCfg.entryActive)
- {
- debug = new JdbcDebug[totalMethodIds];
- debug[methodId_getBinaryStream] = new JdbcDebug(className,"getBinaryStream");
- debug[methodId_getBytes] = new JdbcDebug(className,"getBytes");
- debug[methodId_position_LJ] = new JdbcDebug(className,"position[LJ]");
- debug[methodId_position_BJ] = new JdbcDebug(className,"position[BJ]");
- debug[methodId_setBinaryStream] = new JdbcDebug(className,"setBinaryStream");
- debug[methodId_setBytes_JB] = new JdbcDebug(className,"setBytes[JB]");
- debug[methodId_setBytes_JBII] = new JdbcDebug(className,"setBytes[JBII]");
- debug[methodId_populate] = new JdbcDebug(className,"populate");
- debug[methodId_populateFromBlob] = new JdbcDebug(className,"populateFromBlob");
- debug[methodId_findBytes] = new JdbcDebug(className,"findBytes");
- debug[methodId_SQLMXBlob_LLJ] = new JdbcDebug(className,"SQLMXBlob[LLJ]");
- debug[methodId_SQLMXBlob_LLJLI] = new JdbcDebug(className,"SQLMXBlob[LLJLI]");
- debug[methodId_SQLMXBlob_LLJL] = new JdbcDebug(className,"SQLMXBlob[LLJL]");
- debug[methodId_SQLMXBlob_LLJB] = new JdbcDebug(className,"SQLMXBlob[LLJB]");
- debug[methodId_prepareGetLobLenStmt] = new JdbcDebug(className,"prepareGetLobLenStmt");
- debug[methodId_prepareDelLobDataStmt] = new JdbcDebug(className,"prepareDelLobDataStmt");
- debug[methodId_prepareGetLobDataStmt] = new JdbcDebug(className,"prepareGetLobDataStmt");
- debug[methodId_prepareUpdLobDataStmt] = new JdbcDebug(className,"prepareUpdLobDataStmt");
- debug[methodId_prepareInsLobDataStmt] = new JdbcDebug(className,"prepareInsLobDataStmt");
- debug[methodId_prepareTrunLobDataStmt] = new JdbcDebug(className,"prepareTrunLobDataStmt");
- debug[methodId_getGetLobLenStmt] = new JdbcDebug(className,"getGetLobLenStmt");
- debug[methodId_getDelLobDataStmt] = new JdbcDebug(className,"getDelLobDataStmt");
- debug[methodId_getTrunLobDataStmt] = new JdbcDebug(className,"getTrunLobDataStmt");
- debug[methodId_getInsLobDataStmt] = new JdbcDebug(className,"getInsLobDataStmt");
- debug[methodId_getUpdLobDataStmt] = new JdbcDebug(className,"getUpdLobDataStmt");
- debug[methodId_getGetLobDataStmt] = new JdbcDebug(className,"getGetLobDataStmt");
- }
- }
-
- public void free() throws SQLException {
- // TODO Auto-generated method stub
-
- }
-
- public InputStream getBinaryStream(long pos, long length)
- throws SQLException {
- // TODO Auto-generated method stub
- return null;
- }
-
-}