[id='discovery-jdbcping_{context}']
= JDBC_PING
JDBC_PING 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_PING configuration example
[source, xml]
----
include::xml/jdbc_ping.xml[]
----

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

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

Add a managed datasource to a {brandname} Server and use it to provide database connections for the cluster transport JDBC_PING 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_PING` 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
* link:{jgroups_docs}#_jdbc_ping[JDBC_PING]
* link:http://community.jboss.org/wiki/JDBCPING[JDBC_PING Wiki]
