0
votes

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.)

1

1 Answers

0
votes

It has nothing to do with JMeter, the error you're getting indicates that the JDBC Driver cannot communicate with the database server.

Checklist:

  1. 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)

  2. Make sure that the port is open in your operating system firewall

  3. Cross-check the JDBC driver version as in case of mismatch the communication may fail

  4. Double check the validation query, there are some presets for different database types in the JDBC Connection Configuration

    enter image description here

  5. 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" />