JMeter 5.2.1 - Connection properties is ignored - oracle

I checked using JMeter 5.2.1 the connection properties feature with oracle
Bug 63926 - JDBC Connection Configuration: Add ability to set connection properties
But even if I give wrong values in Oracle connection options as
user=notexists;internal_logon=irrelevant
JDBC request is executing normal, meaning it didn't use the wrong connection properties
JMeter uses dbcp2's BasicDataSource connection properties, but it seems to be ignoring when sending JDBC queries

I just tried it in 5.2.1 oracle.jdbc.OracleDriver from ojdbc10.jar downloaded from OTN and it works ok (it takes the properties).
In the "JDBC Connection Configuration", did you set the "JDBC Driver Class" as "oracle.jdbc.OracleDriver".
You also need to add ojdbc10.jar in JMETER_HOME/lib/ext.

Here are the images from Pablo.

Related

Specify v$session.program for R2DBC Oracle connection

I was trying to set the v$session.program at the connection from a R2DBC Oracle connection (within a Spring application)
For now I've tried this but without success.
ConnectionFactories.get(ConnectionFactoryOptions.parse(dbUrl).mutate().option(Option.valueOf("v$session.program"), "PROGRAMNAME").build());
Would this be possible to set in any way?
Thanks for help.
Oracle R2DBC 0.4.0 does not support the v$session properties as ConnectionFactoryOptions. However, I think it should, so I'll be adding support for that in the next release of Oracle R2DBC.
If anyone needs a temporary workaround, these properties can be set as JVM system properties. System properties will bypass Oracle R2DBC's connection property filter.

Jmeter and Oracle Connections - JDBC Request

When I try to use the JDBC Connector I'm getting this error when I go to try and send a SQL.
I'm getting a weird error that I don't understand when trying to connect a JDBC request to an Oracle DB.
java.lang.AbstractMethodError: Receiver class oracle.jdbc.driver.T4CConnection does not define or inherit an implementation of the resolved method abstract isValid(I)Z of interface java.sql.Connection.
at or
What's going on here? #jmeter
JDBC driver might be outdated. Does ojdbc8.jar exist in your Jmeter/lib directory?
If not, try downloading it to that directory from the link below. Then, re-start Jmeter and reattempt the connection.
https://www.oracle.com/technetwork/database/application-development/jdbc/downloads/jdbc-ucp-183-5013470.html
You should add ojdbc7.jar to your Test Plan
You can click on Browse and add it, Save Test Plan and restart JMeter

How to resolve error "Cannot load JDBC driver class" displayed in jmeter 4.0

I recently updated to jmeter 4.0 from jmeter 3.2. In jmx file, i have query to execute and it was running fine in jmeter 3.2 . But the jmx file fails with error "Response message: java.sql.SQLException: Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'" in jmeter 4.0. Please help me in resolving this issue.
below is the screenshot of JDBC Connection Configuration
You need to
Download Microsoft JDBC Driver for SQL Server
Extract mssql-jdbc-x.x.x.jrex.jar somewhere to JMeter Classpath
Restart JMeter to pick the .jar up
See Building a Database Test Plan and How to use Different JDBC Drivers articles for more details on how to use JMeter for database testing.

Not able to send jdbc request in JMeter

No suitable driver found for jdbc:oracle for JDBC request in JMeter.
Configuration details:
Suggest if any changes required to resolve it.
Make sure your add Oracle JDBC driver to JMeter Classpath and restart JMeter afterwars.
I am not sure that copying and pasting tnsnames.ora into the JDBC URL is supported, as far as I'm aware you need to set oracle.net.tns_admin system property and use TNS entry in the JDBC URL like jdbc:oracle:thin:#your_entry_name_here
I also believe you should change your "Validation query" to SELECT 1 FROM DUAL
More information:
DBCP - validationQuery for different Databases
Database JDBC Developer's Guide and Reference
The Real Secret to Building a Database Test Plan With JMeter

Configure JDBC oracle specific property v$session.program using Jboss and JPA (hibernate)

I'd like to set the v$session.program Oracle property in order to have information available in the session table. I'm using JPA with a jndi XA datasource created with an oracle-xa-ds.xml deployed in the deploy folder of Jboss, and therefore I haven't access to the constructor of the Connection.
I have access to the Connection object, in JPA 2 using unwrap, in JPA 1 by casting JPA to Hibernate classes, but there are no properties setter (only Client Info properties that are the way to proceed starting JDBC 4.0).
So my question is, using JPA (with Hibernate) using Jboss 4.2 :
Is it possible to configure the v$session.program in the persistence.xml ?
Is it possible to configure the v$session.program in the oracle-ds.xml ?
Is their any other approach to the solution ?
Thank you for any valuable comments and answers !
I had the same Problem today, after much fiddeling and reading documentation finally I had the Eureka moment:
Add following parameter:
<xa-datasource-property name="connectionProperties">v$session.program=YourUniqueName</xa-datasource-property>
Thats all.
I'm pretty sure this must be documented somewhere but here is what we can find in the JBoss wiki:
How To Specify "PROGRAM" Oracle Connection Property
JBoss Version: JBoss 4.0.3 SP1, Oracle DB Version: 10g
To be able to distinguish the JDBC
connections on the Oracle server side,
which are created by different JBoss
instances, Oracle's PROGRAM connection
property might be set within the
Oracle specific JDBC datasource config
file by using the following tags:
<connection-property name="v$session.program">ADistinguishedNameForPROGRAMProperty</connection-property>
i.e.
...
<connection-url>AConnectionURL</connection-url>
<connection-property name="v$session.program">ADistinguishedNameForPROGRAMProperty</connection-property>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
...
That way the DBAs can have proper
granularity in:
AWRs
v$session view
Other tools which are checking/evaluating PROGRAM connection
property

Resources