Thanks for the confirmation on that, Deepak.

I had also poked around the code and found pretty much a "smoking gun" to back 
up my suspicion in AbstractJDBCTestElement. resultSetsToString() where it loops 
through the declared variables and (if not an instance of java.sql.ResultSet) 
it does this:

    jmvars.put(name, o == null ? null : o.toString())

Since a CLOB (from Oracle) doesn't provide its content on a .toString(), the 
desired results aren't provided.

I hacked the JDBC Sampler (the Abstract parent, to be precise) and put a patch 
in an enhancement request 
(https://bz.apache.org/bugzilla/show_bug.cgi?id=60066) with the caveat that 
it's quick and dirty and there are likely other areas of the code that should 
be made more CLOB-friendly.  At the same time, there could be DB-dependent 
quirks ... so it may require some finesse.

I don't have an opportunity to add the finesse required for a PR on the 
enhancement ... but at least it will leave some bunny trails for others to 
follow if they choose.

Not sure what your concern was re/ the link?  The response (by shettyd) to the 
initial question states that JMeter didn't support OUT CLOB for Oracle at that 
time.  My question was if that's still the case... which we have now 
definitively confirmed it is.

Thanks again ... 
jz

-----Original Message-----
From: Deepak Shetty [mailto:shet...@gmail.com] 
Sent: August-29-16 6:58 PM
To: JMeter Users List <user@jmeter.apache.org>
Subject: Re: CLOB Supported in JDBC Sampler

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.zwi...@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.htm
> l
>
> 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-unsubscr...@jmeter.apache.org
> For additional commands, e-mail: user-h...@jmeter.apache.org
>
>

Reply via email to