0
votes

I am trying to test some JDBC methods using apache jmeter like getFunctions. I have successfully created DB connection and executed a query to create one function. Now I wanted to test the output of getFunctions method. For this I am using JDBC Request Sampler. I have done below configuration for the JDBC request Sampler to test this method enter image description here

When I run this Test I am getting below error

Response message: java.sql.SQLSyntaxErrorException: [XXXX][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near 'NULL'.

I tried 'NULL' , "NULL" and $NULL$ but all are giving same exception.

Can someone please guide me how can I test such methods using JDBC request in Apache Jemeter

1

1 Answers

0
votes

As far as I can see from getFunctions() method description it is applicable to DatabaseMetaData therefore unfortunately you won't be able to use JDBC Request sampler for testing this method.

The solution would be switching to JSR223 Sampler and Groovy language, the relevant code would be something like:

def conn = org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection('foo')
def resultSet = conn.getMetaData().getFunctions(null,null,null)

Demo:

JMeter JDBC get functions