My Oracle Support Banner

Java Sample To Test Multiple Connections,Verify Load Balancing And Check Connection Time (Doc ID 429646.1)

Last updated on MARCH 22, 2022

Applies to:

JDBC - Version and later
Information in this document applies to any platform.


This sample can be used to:

  1. test multiple connections
  2. test load balancing.
  3. find out the connection time.

This sample is useful when some of your JDBC connections fail in a load balancing environment. Since the try-catch block is within the while loop that executes the method getConnection you can see to what host connections are successful.

Also this sample can be used to test if load balancing is working.  If load balancing is working the query will return the different host selected by the load balancer. 

Troubleshooting Steps

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
Troubleshooting Steps

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.