Bug 40825 - JDBC Sample doesn't support PreparedStatements or CallableStatements with arguments
JDBC Sample doesn't support PreparedStatements or CallableStatements with arg...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.2
Other other
: P2 enhancement with 1 vote (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-10-27 02:56 UTC by Rub
Modified: 2007-04-25 01:30 UTC (History)
0 users



Attachments
Support for JDBC PreparedStatements and CallableStatements with parameters (15.03 KB, patch)
2006-10-27 03:03 UTC, Rub
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rub 2006-10-27 02:56:57 UTC
This one is related to Bug #38682
http://issues.apache.org/bugzilla/show_bug.cgi?id=38682

Currently there is no way to benchmark the execution of JDBC PreparedStatements.
Even for CallableStatements that are a subclass of PreparedStatements are not
fully  supported now. Because no "true" parameters ( '?' in the sql statemetns)
are allowed then it's not possible to execute RPC to stored procedures in all
jdbc drivers. Lots of JDBC drivers doesn't execute a RPC call if the
CallableStatement has no parameters. i.e the following statement

call s2('id1000') 

will translate in Sybase ASE to a TDS_LANG query but the following statement

call s2(?)

will translate to TDS_RPC that is much faster and the preferred way to access
the database.
Comment 1 Rub 2006-10-27 03:03:44 UTC
Created attachment 19044 [details]
Support for JDBC PreparedStatements and CallableStatements with parameters

Adds support for JDBC PreparedStatement. 

Two boxes in the lower part of the windows allow to enter a comma separated
list of parameter values and a comma separated list of parameter types
(VARCHAR, INTEGER, etc).
Comment 2 Rub 2006-12-14 06:50:57 UTC
I've created a plugin with a new JDBC Sampler supporting the PreparedStatements.
Anyone interested in using it can check it out at
http://rubenlaguna.com/wp/2006/12/14/enhanced-jdbc-sampler-for-apache-jmeter/
Comment 3 Sebb 2006-12-14 07:37:32 UTC
Version 2.2.1 does not exist (yet)
Comment 4 Sebb 2007-04-14 18:55:32 UTC
Thanks for the patch, which has been applied in SVN r528906.

I changed the code to set up mapJdbcNameToInt using a static initialiser.
Comment 5 Rub 2007-04-25 01:30:47 UTC
I posted an attachment in Bug #42018  to allow commits and rollback that
currently aren't supported in JMeter. (At least not supported in all databases,
i.e Apache Derby). 

(In reply to comment #4)
> Thanks for the patch, which has been applied in SVN r528906.
> 
> I changed the code to set up mapJdbcNameToInt using a static initialiser.
>