1
votes

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? enter image description here

2

2 Answers

1
votes

You need two basic things to get that done:

  1. Tunneling
  2. mysql.jdbc jar in JMeter lib folder.

For 1st:

  1. Open Putty
  2. Go to Connection >> SSH >> Tunnels
  3. Put down the details as port: 9876
  4. 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
    
  5. Add it

    Stack

  6. Open JMeter >> Add JDBC Connection Configuration

  7. Use DataBase URL as jdbc:mysql://localhost:9876 and the other details as shown in the picture, like JDBC driver Class

    JDBC

For step 2. Go through this link: https://www.blazemeter.com/blog/mysql-database-and-jmeter-how-to-test-your-connection/

0
votes

Looking into Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J article:

JDBC URL Format

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.