You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Jacob Zwiers <Ja...@tpsgc-pwgsc.gc.ca> on 2016/08/29 17:52:30 UTC

CLOB Supported in JDBC Sampler

After some trial and error, I found this post (circa 2014) which claims CLOB is not supported in the JDBC Sampler: http://jmeter.512774.n5.nabble.com/Get-CLOB-from-JDBC-Request-Callable-Statement-td5719661.html

Is that accurate / still the case?

Thought I'd ask before spelunking the code and/or plotting an alternative.

FWIW, my work so far has this code in a BeanShellPostProcessor ...
   Object resultClob = vars.getObject("proc_result" );
   log.info( "test " + resultClob.getClass().getName() +  " : " + resultClob.toString() );

... which prints ... 
   2016/08/29 13:32:35 INFO  - jmeter.util.BeanShellTestElement: test java.lang.String : oracle.sql.CLOB@5d686ee2

... after a JDBC Sampler which has a Callable Statement with 
   Query: call procName('SEARCH', 1, 4, 'SIMPLE', null,'SOME TEXT', ?)
   Parameter Value: ]NULL[
   Parameter Types: INOUT CLOB
   Variable Names: proc_result

Looks to me like the CLOB is being "converted" to a String with .toString() somewhere in the internals (rather than calling oracle.sql.CLOB.stringValue() or providing access to the stream). 

Thanks...
jz

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: CLOB Supported in JDBC Sampler

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
atleast a quick look doesnt show CLOBs being handled in JMeter source (and
whatever you linked to doesnt say that either).
Note that different drivers work differently . SQL Server does (or did per
memory) return CLOBs as String , though Oracle's driver never did - You
either need to enhance JDBCSampler (or create an enhancement request for
JMeter) or run the query using a java sampler.

regards
deepak

On Mon, Aug 29, 2016 at 10:52 AM, Jacob Zwiers <
Jacob.Zwiers@tpsgc-pwgsc.gc.ca> wrote:

> After some trial and error, I found this post (circa 2014) which claims
> CLOB is not supported in the JDBC Sampler: http://jmeter.512774.n5.
> nabble.com/Get-CLOB-from-JDBC-Request-Callable-Statement-td5719661.html
>
> Is that accurate / still the case?
>
> Thought I'd ask before spelunking the code and/or plotting an alternative.
>
> FWIW, my work so far has this code in a BeanShellPostProcessor ...
>    Object resultClob = vars.getObject("proc_result" );
>    log.info( "test " + resultClob.getClass().getName() +  " : " +
> resultClob.toString() );
>
> ... which prints ...
>    2016/08/29 13:32:35 INFO  - jmeter.util.BeanShellTestElement: test
> java.lang.String : oracle.sql.CLOB@5d686ee2
>
> ... after a JDBC Sampler which has a Callable Statement with
>    Query: call procName('SEARCH', 1, 4, 'SIMPLE', null,'SOME TEXT', ?)
>    Parameter Value: ]NULL[
>    Parameter Types: INOUT CLOB
>    Variable Names: proc_result
>
> Looks to me like the CLOB is being "converted" to a String with
> .toString() somewhere in the internals (rather than calling
> oracle.sql.CLOB.stringValue() or providing access to the stream).
>
> Thanks...
> jz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>