From ad66257da31afcaeefd8a76ed95cb1c6e0a0bfd1 Mon Sep 17 00:00:00 2001 From: John Eberhard Date: Fri, 23 Aug 2024 12:44:04 -0500 Subject: [PATCH] Improve setClob tracing Signed-off-by: John Eberhard --- .../com/ibm/as400/access/AS400JDBCCallableStatement.java | 6 +++--- .../ibm/as400/access/AS400JDBCPreparedStatementImpl.java | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ibm/as400/access/AS400JDBCCallableStatement.java b/src/main/java/com/ibm/as400/access/AS400JDBCCallableStatement.java index cabccc0b7..2ae4afe1c 100644 --- a/src/main/java/com/ibm/as400/access/AS400JDBCCallableStatement.java +++ b/src/main/java/com/ibm/as400/access/AS400JDBCCallableStatement.java @@ -4113,7 +4113,7 @@ public void setClob(String parameterName, Clob x) throws SQLException { if(JDTrace.isTraceOn()) { - JDTrace.logInformation(this, "setClob()"); + JDTrace.logInformation(this, "setClob(String,Clob)"); if(x == null) JDTrace.logInformation(this, "parameter index: " + findParameterIndex(parameterName) + " value: NULL"); else JDTrace.logInformation(this, "parameter index: " + findParameterIndex(parameterName) + " length: " + x.length()); @@ -4146,7 +4146,7 @@ public void setClob(String parameterName, Reader reader, long length) throws SQL { if(JDTrace.isTraceOn()) { - JDTrace.logInformation(this, "setClob()"); + JDTrace.logInformation(this, "setClob(String,Reader,long)"); if(reader == null) JDTrace.logInformation(this, "parameter index: " + findParameterIndex(parameterName) + " value: NULL"); else JDTrace.logInformation(this, "parameter index: " + findParameterIndex(parameterName) + " length: " + length); @@ -4319,7 +4319,7 @@ public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLExceptio { if(JDTrace.isTraceOn()) { - JDTrace.logInformation(this, "setClob()"); + JDTrace.logInformation(this, "setSQLXML()"); if(xmlObject == null) JDTrace.logInformation(this, "parameter index: " + findParameterIndex(parameterName) + " value: NULL"); else JDTrace.logInformation(this, "parameter index: " + findParameterIndex(parameterName) + " length: " + xmlObject.toString().length()); diff --git a/src/main/java/com/ibm/as400/access/AS400JDBCPreparedStatementImpl.java b/src/main/java/com/ibm/as400/access/AS400JDBCPreparedStatementImpl.java index a40af4d73..c56f7f44f 100644 --- a/src/main/java/com/ibm/as400/access/AS400JDBCPreparedStatementImpl.java +++ b/src/main/java/com/ibm/as400/access/AS400JDBCPreparedStatementImpl.java @@ -2885,21 +2885,23 @@ public void setClob(int parameterIndex, Clob parameterValue) // JDError.EXC_PARAMETER_TYPE_INVALID); if (JDTrace.isTraceOn()) { // @H1A - JDTrace.logInformation(this, "setClob()"); // @H1A + JDTrace.logInformation(this, "setClob(int,Clob)"); // @H1A if (parameterValue == null) // @H1A JDTrace.logInformation(this, "parameter index: " + parameterIndex + " value: NULL"); // @H1A - else if (parameterValue.length() > maxToLog_) // @H1A + else if (parameterValue.length() < maxToLog_) // @H1A JDTrace .logInformation( this, "parameter index: " + parameterIndex + + " class: "+parameterValue.getClass().getName() + " value: " + parameterValue.getSubString(1, (int) parameterValue.length())); // @H1A else JDTrace.logInformation(this, "parameter index: " + parameterIndex + + " class: "+parameterValue.getClass().getName() + " length: " + parameterValue.length()); // @H1A } // @H1A @@ -4054,12 +4056,13 @@ else if(value.length() > maxToLog_) public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { if (JDTrace.isTraceOn()) { - JDTrace.logInformation(this, "setClob()"); + JDTrace.logInformation(this, "setClob(int,Reader,long)"); if (reader == null) JDTrace.logInformation(this, "parameter index: " + parameterIndex + " value: NULL"); else JDTrace.logInformation(this, "parameter index: " + parameterIndex + + " class: "+reader.getClass().getName() + " length: " + length); }