Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve setClob tracing #198

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
}

Expand Down