Database connection for JDBC request on jmeter - jdbc

For JDBC request on Jmeter I have configured properly Database Connection Configuration with giving
Database Url- jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-1.rds.amazonaws.com;Development_DB
JDBC Driver Class- com.mysql.jdbc.Driver
Username-...
Password-...
then I create a JDBC request with Select Statementbut after run this request,on the response message got this message-
Response message:
java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the
server was 0 milliseconds ago. The driver has not received any packets
from the server.)
Now my question is , how to solve this problem?

You need two basic things to get that done:
Tunneling
mysql.jdbc jar in JMeter lib folder.
For 1st:
Open Putty
Go to Connection >> SSH >> Tunnels
Put down the details as port: 9876
Put down the details as database URL (present in the application config file), e.g:
jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-.rds.amazonaws.com;Development_DB
Add it
Open JMeter >> Add JDBC Connection Configuration
Use DataBase URL as jdbc:mysql://localhost:9876 and the
other details as shown in the picture, like JDBC driver Class
For step 2. Go through this link:
https://www.blazemeter.com/blog/mysql-database-and-jmeter-how-to-test-your-connection/

Looking into Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J article:
I believe you need to replace the semicolon before Development_DB with a slash like:
jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-1.rds.amazonaws.com/Development_DB
For more information on databases load testing see The Real Secret to Building a Database Test Plan With JMeter article.
You might also need to open port 3306 in your operating system firewall and add the relevant Security Group to your instance in order to allow MySQL JDBC traffic.

Related

Getting Response message:java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure) in jmeter

I am trying to connect jmeter with the database and getting this exception after 20 seconds.
Response message:java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
It has nothing to do with JMeter, the error you're getting indicates that the JDBC Driver cannot communicate with the database server.
Checklist:
Make sure that the database server is up and running and listening on an external network interface (sometimes by default the database is bond to the localhost)
Make sure that the port is open in your operating system firewall
Cross-check the JDBC driver version as in case of mismatch the communication may fail
Double check the validation query, there are some presets for different database types in the JDBC Connection Configuration
Look for suspicious entries in jmeter.log file, it's possible to increase the JMeter logging verbosity for JDBC test elements by adding the next line to log4j2.xml file:
<Logger name="org.apache.jmeter.protocol.jdbc" level="debug" />

Not able to connect to iothub using device connection string - Jmeter

I am trying to connect 100 mqtt clients to iothub using jmeter.
In mqtt connection panel, for pwd, am using iothubowner connection string (available in shared access policy page in azure portal), from which SAS get generated & using the same in pwd for all 100 clients.
connection is successful as well.
but when i try to use the respective client connection string, from which SAS get generated using device explorer, get applied in pwd and the connection get failed.
Any help pls.
JMeter executes Samplers upside down by each virtual user so you don't need to duplicate this Gateway Connect sampler, just define 2 threads (virtual users) in the Thread Group and each thread (virtual user) will execute Gateway Connect sampler and establish its own connection with the broker.
The credentials can be parameterized using i.e. CSV Data Set Config so each virtual user would connect with its own username/password combination
More information: Testing the MQTT Messaging Broker for IoT - A Guide
Am not sure still why respective connection string is creating props, but in such case, the recommended solution is to use iothubowner connection string from the shared access policy page. It's quite successful.

coldfusion v 10 std unable to connect to oracle via jdbc oci driver

I am trying to establish a jdbc-oci connection to an oracle database on a coldfusion v 10 std server.
The reason for employing jdbc oci is the necessity to encrypt data flowing between the app server and the database (by using common settings in sqlnet.ora). However, no matter what syntax we try, neither a service
based nor a tnsnames based jdbc url will work. Immediately after saving (and automatically testing) the connection, coldfusion errors out with "java.sql.SQLException: Timed out trying to establish connection".
It looks weird that a timeout may have happened since the error will always be thrown immediately. Therefor I suppose there is another root cause for failing to establish the connection.
Any ideas out there?
Please note that we simulated connection establishment with a console application aside coldfusion but using the same jvm and jdbc driver successfully. it does therefore not seem to be a jvm or driver or oci.dll
related issue.
data source settings :
Driver Class : oracle.jdbc.driver.OracleDriver
JDBC URL (using tnsnames.ora) : jdbc:oracle:oci:#<theName>
JDBC URL (using ip, port, service) : jdbc:oracle:oci:#//<IP>:1521/<SID>
error message :
Connection verification failed for data source: theName
java.sql.SQLException: Timed out trying to establish connection
The root cause was that: java.sql.SQLException: Timed out trying to establish connection
environment :
ojdbc6 driver lives in a directory known to coldfusion
oci.dll lives in a directory known to the system path variable, verified by sysinternals processexplorer on the coldfusion service
for the JDBC URL (using tnsnames.ora), the directory containing tnsnames.ora is known as a system variable TNS_ADMIN, verified by sysinternals processexplorer on the coldfusion service
along with tnsnames.ora there is a sqlnet.ora file comprising settings to switch on data encryption
Stacktrace:
A non-SQL error occurred while requesting a connection from "datasource-name here".
Timed out trying to establish connection
Exception in thread "Thread-2120" java.lang.UnsatisfiedLinkError: no ocijdbc11 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:3560)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:3556)
at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:269)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
at oracle.jdbc.driver.T2CConnection.<init>(T2CConnection.java:165)
at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:53)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
at coldfusion.server.j2ee.sql.pool.JDBCPool.createPhysicalConnection(JDBCPool.java:614)
at coldfusion.server.j2ee.sql.pool.ConnectionRunner$RunnableConnection.run(ConnectionRunner.java:67)
at java.lang.Thread.run(Thread.java:722)
A non-SQL error occurred while requesting a connection from "datasource-name here".
Timed out trying to establish connection
[Fatal Error] :2662:4: The element type "view" must be terminated by the matching end-tag "</view>".
Adding of the Path to the oracle instant client at the configuration file cf-directory\cfusion\bin\jvm.config has solved the problem.

Cannot establish a connection to orientdb using jdbc driver?

I'm newbie to the orientdb, I'm using netbeans's (add new connection wizard) to add a connection to the orientdb, I used orientdb-jdbc-2.0.2-all.jar as a jdbc driver, but I got the following error after clicking on test connection
Snapshot of the error
I made sure that the database is connected and everything is right, any idea?
The URL should be jdbc:orient:remote:localhost/Sensor_Data
Look at the documentation: http://www.orientechnologies.com/docs/last/orientdb-jdbc.wiki/Home.html#first-get-a-connection.
the problem should be in the connection port. You are using 2480 (HTTP port) instead of 2424 (binary protocol).

dotCMS in Jelastic cloud (define jdbc url)

I've tried to follow this article http://docs.jelastic.com/jelastic-dotcms-deploy , but actually when I started application I get an error:
SEVERE: Exception starting filter URLMapFilter
com.dotmarketing.exception.DotRuntimeException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
I understand that there is a problem with jdbc url , but I can't fix it.
Any suggestions?
Thanks for clarifying.
Your JDBC URL should be like this:
jdbc:mysql://mysql-env-giph.j.rsnx.ru/dotcms
Note the mysql- not mysql.
EDIT: http://docs.jelastic.com/connection-to-mysql may help to clarify it further (in the docs, the environment name is "mysqlconnection", so they use "mysql-mysqlconnection" for the MySQL server.
The format is always like this:
host=jdbc:mysql://mysql-{your_env_name}.{hoster_domain}/{db_name}

Resources