Configuring GemFire XD as a JDBC Datasource
The GemFire XD JDBC implementation enables you to use a distributed system as an embedded JDBC datasource in products such as WebLogic Server.
- Copy the gemfirexd-client.jar file to the location where other JDBC drivers for the product are stored.
- For products such as WebLogic Server that provide datasource templates, select "Apache Derby," "User-defined," or "Other" as the database type if GemFire XD is not explicitly supported.
- Specify "gemfirexd" as the database name. This represents a single GemFire XD distributed system. (GemFire XD does not contain multiple databases as in Apache Derby or other relational database systems.)
- For the hostname and port, specify the hostname and port combination of a GemFire XD locator or a GemFire XD server. This is the same hostname and port combination you would use to connect as a client from the gfxd prompt.
- For the database username
and password, enter a valid username and password combination if you have
enabled authentication in your system (using the
If you have not configured authentication in GemFire XD, specify "app" as both the username and password values, or any other temporary value.Note: GemFire XD uses the username specified in the JDBC connection as the schema name when you do not provide the schema name for a database object. GemFire XD uses "APP" as the default schema. If your system does not enable authentication, you can specify "APP" for both the username and password to maintain consistency with the default schema behavior.
- For the driver class, specify: com.pivotal.gemfirexd.internal.jdbc.ClientConnectionPoolDataSource
- The JDBC URL that you
specify must begin with
jdbc:gemfirexd://. Remove any template properties such
create=true if they are present in the URL or
In products such as WebLogic, you cannot specify JDBC connection properties for an embedded datasource as part of the JDBC URL. Instead, use the properties field and specify connectionAttributes using the format:
connectionAttributes=attribute;attribute;...For example: connectionAttributes=mcast-address=126.96.36.199;mcast-port=10334 or connectionAttributes=locators=188.8.131.52;mcast-port=0
See also the Apache Derby documentation for EmbeddedDataSource.
- A process can connect to only one GemFire XD distributed system at a time. If you want to connect to a different GemFire XD distributed system, shut down the current embedded data source before re-connecting with a different datasource.