ASF Bugzilla – Attachment 34184 Details for
Bug 60066
JDBC Sampler: Provide Support for CLOB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Quick hack of AbstractJDBCTestElement to support CLOB OUT
AbstractJDCBCTestElement-ReturnContentOfCLOB.patch.txt (text/plain), 2.11 KB, created by
Jacob Zwiers
on 2016-08-30 11:42:42 UTC
(
hide
)
Description:
Quick hack of AbstractJDBCTestElement to support CLOB OUT
Filename:
MIME Type:
Creator:
Jacob Zwiers
Created:
2016-08-30 11:42:42 UTC
Size:
2.11 KB
patch
obsolete
>Index: src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java >=================================================================== >--- src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java (revision 1758287) >+++ src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java (working copy) >@@ -19,9 +19,11 @@ > package org.apache.jmeter.protocol.jdbc; > > import java.io.IOException; >+import java.io.Reader; > import java.io.UnsupportedEncodingException; > import java.lang.reflect.Field; > import java.math.BigDecimal; >+import java.nio.CharBuffer; > import java.nio.charset.StandardCharsets; > import java.sql.CallableStatement; > import java.sql.Connection; >@@ -305,6 +307,27 @@ > jmvars.put(name, o.toString()); > } > } >+ else if ( o instanceof java.sql.Clob ) { >+ java.sql.Clob clob = (java.sql.Clob)o; >+ long rawClobLength = clob.length(); >+ int contentBufferLength = rawClobLength > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)rawClobLength; >+ >+ CharBuffer buffer = CharBuffer.allocate(contentBufferLength); >+ try { >+ Reader clobReader = clob.getCharacterStream(); >+ int currentRead; >+ int totalRead = 0; >+ do { >+ currentRead = clobReader.read(buffer); >+ totalRead += currentRead; >+ } while ( currentRead != -1 ); >+ >+ buffer.flip(); >+ } catch ( IOException ioex ) { >+ sb.append( "Error processing clob: " + ioex.toString() ); >+ } >+ jmvars.put(name, buffer.toString()); >+ } > else { > jmvars.put(name, o == null ? null : o.toString()); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60066
:
34184
|
34229