Index: java/engine/org/apache/derby/impl/sql/GenericParameter.java
===================================================================
--- java/engine/org/apache/derby/impl/sql/GenericParameter.java	(revision 467296)
+++ java/engine/org/apache/derby/impl/sql/GenericParameter.java	(working copy)
@@ -331,11 +331,11 @@
 		{
 			try
 			{
-				return value.getString();
+				return value.getTraceString();
 			}
 			catch (StandardException se)
 			{
-				return "unexpected exception from getString() - " + se;
+				return "unexpected exception from getTraceString() - " + se;
 			}
 		}
 	}
Index: java/engine/org/apache/derby/iapi/types/SQLBlob.java
===================================================================
--- java/engine/org/apache/derby/iapi/types/SQLBlob.java	(revision 467296)
+++ java/engine/org/apache/derby/iapi/types/SQLBlob.java	(working copy)
@@ -168,6 +168,25 @@
     }
 
     /**
+     * Gets a trace representation of the BLOB for debugging.
+     *
+     * @return a trace representation of the BLOB.
+     */
+    public final String getTraceString() throws StandardException {
+        // Check if the value is SQL NULL.
+        if (isNull()) {
+            return "NULL";
+        }
+
+        // Check if we have a stream.
+        if (getStream() != null) {
+            return ("BLOB(" + getStream().toString() + ")");
+        }
+
+        return ("BLOB(" + getLength() + ")");
+    }
+
+    /**
 	   Return my format identifier.
            
 	   @see org.apache.derby.iapi.services.io.TypedFormat#getTypeFormatId
Index: java/engine/org/apache/derby/iapi/types/SQLClob.java
===================================================================
--- java/engine/org/apache/derby/iapi/types/SQLClob.java	(revision 467296)
+++ java/engine/org/apache/derby/iapi/types/SQLClob.java	(working copy)
@@ -199,6 +199,24 @@
 		throw dataTypeConversion("java.sql.Timestamp");
 	}
     
+    /**
+     * Gets a trace representation of the CLOB for debugging.
+     *
+     * @return a trace representation of the CLOB.
+     */
+    public final String getTraceString() throws StandardException {
+        // Check if the value is SQL NULL.
+        if (isNull()) {
+            return "NULL";
+        }
+
+        // Check if we have a stream.
+        if (getStream() != null) {
+            return ("CLOB(" + getStream().toString() + ")");
+        }
+
+        return ("CLOB(" + getLength() + ")");
+    }
     
     /**
      * Normalization method - this method may be called when putting
Index: java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java
===================================================================
--- java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java	(revision 467296)
+++ java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java	(working copy)
@@ -124,6 +124,15 @@
 	 */
 	String	getString() throws StandardException;
 
+    /**
+     * Gets the value in the data value descriptor as a trace string.
+     * If the value itself is not suitable for tracing purposes, a more
+     * suitable representation is returned. For instance, data values
+     * represented as streams are not materialized. Instead, information about
+     * the associated stream is given.
+     */
+    String getTraceString() throws StandardException;
+
 	/**
 	 * Gets the value in the data value descriptor as a boolean.
 	 * Throws an exception if the data value is not a boolean.
Index: java/engine/org/apache/derby/iapi/types/DataType.java
===================================================================
--- java/engine/org/apache/derby/iapi/types/DataType.java	(revision 467296)
+++ java/engine/org/apache/derby/iapi/types/DataType.java	(working copy)
@@ -231,6 +231,19 @@
 			MessageService.getTextMessage(SQLState.LANG_STREAM));
 	}
 
+    /**
+     * Gets the value in the data stream descriptor as a trace string.
+     * This default implementation simply forwards the call to
+     * <code>getString</code>.
+     *
+     * @return The data value in a representation suitable for tracing.
+     * @throws StandardException if getting the data value fails.
+     * @see DataValueDescriptor#getString
+     */
+    public String getTraceString() throws StandardException {
+        return getString();  
+    }
+
 	/*
 	 * Column interface
 	 */
