The JDBC URL expected for the use with Sequoia is the following:
jdbc:sequoia://host1:port1,host2:port2/database
host is the machine name (or IP address) where the Sequoia controller is running, port is the port the controller is listening for client connections.
At least one host must be specified but a list of comma separated hosts can be specified. If several hosts are given, one is picked up randomly from the list. If the currently selected controller fails, another one is automatically picked up from the list.
The port is optional in the URL and the default port number is 25322 if it is omitted. Those two examples are equivalent:
jdbc:sequoia://localhost/tpcw jdbc:sequoia://localhost:25322/tpcw
Examples using two controllers for fault tolerance:
jdbc:sequoia://c1.continuent.org,c2.objectweb.org/tpcw jdbc:sequoia://localhost,remote.continuent.org:2048/tpcw jdbc:sequoia://smpnode.com:25322,smpnode.com:1098/tpcw
URL options
The Sequoia driver accepts additional options to override the default behavior of the driver. The options are appended at the end of the Sequoia URL after a question mark followed by a list of ampersands separated options. Here is an example:
jdbc:sequoia://host/db?user=me&password=secret
Another option is to use semicolons to delimit the start of options and options themselves. Example:
jdbc:sequoia://host/db;user=me;password=secret
The recognized options are:
connectionPooling: By default the Sequoia driver does transparent connection pooling on your behalf meaning that when connection.close() is called, the connection is not physically closed but rather put in a pool for reuse within the next 5 seconds. Set this to false if you do not want the driver to perform transparent connection pooling.
debugLevel: Debug level that can be set to ’debug’, ’info’ or ’off’ to display driver related information on the standard output. Default is off.
escapeBackslash: Set this to false if you don’t want to escape backslashes when performing escape processing of PreparedStatements, default is true.
escapeSingleQuote: Set this to false if you don’t want to escape single quotes (’) when performing escape processing of PreparedStatements, default is true.
escapeCharacter: Character to prepend and append to the String values when performing escape processing of PreparedStatements, default is a single quote.
user: user login
password: user password
preferredController: defines the strategy to use to choose a preferred controller to connect to.
jdbc:sequoia://node1,node2,node3/myDB?preferredController=ordered
Always connect to node1, and if not available then try to node2 and finally if none are available try node3.
jdbc:sequoia://node1,node2,node3/myDB?preferredController=random
Pickup a controller node randomly (default strategy)
jdbc:sequoia://node1,node2:25343,node3/myDB?preferredController=node2:25343,node3
Round-robin between node2 and node3, fallback to node1 if none of node2 and node3 is available.
jdbc:sequoia://node1,node2,node3/myDB?preferredController=roundRobin
Round robin starting with first node in URL.
retryIntervalInMs: once a controller has died, the driver will try to reconnect to this controller every retryIntervalInMs to see if the backend is back online. The default is 5000 (5 seconds).
NOTE: For additional Sequoia configuration details, please consult Sequoia documentation.