[id='discovery-jdbcping_{context}']
= JDBC_PING2
JDBC_PING2 uses shared databases to store information about {brandname} clusters.
This protocol supports any database that can use a JDBC connection.

Nodes write their IP addresses to the shared database so joining nodes can find the {brandname} cluster on the network.
When nodes leave {brandname} clusters, they delete their IP addresses from the shared database.

.JDBC_PING2 configuration example
[source, xml]
----
include::xml/jdbc_ping.xml[]
----

[IMPORTANT]
====
Add the appropriate JDBC driver to the classpath so {brandname} can use JDBC_PING2.
====

[id='discovery-jdbcping-datasource_{context}']
== Using a server datasource for JDBC_PING2 discovery

Add a managed datasource to a {brandname} Server and use it to provide database connections for the cluster transport JDBC_PING2 discovery protocol.

.Prerequisites

* Install a {brandname} Server cluster.

.Procedure

. Deploy a JDBC driver JAR to your {brandname} Server `server/lib` directory
. Create a datasource for your database.
+
[source,xml,options="nowrap",subs=attributes+]
----
include::xml/server_datasources.xml[]
----
+
. Create a JGroups stack which uses the `JDBC_PING2` protocol for discovery.
. Configure cluster transport to use the datasource by specifying the name of the datasource with the `server:data-source` attribute.
+
[source,xml,options="nowrap",subs=attributes+]
----
include::xml/server-transport-datasource.xml[]
----

[role="_additional-resources"]
.Additional resources

* http://www.jgroups.org/manual5/index.html#JDBC_PING2[JDBC_PING2 documentation]
