Product Documentation

FairCom JDBC Developer's Guide

Previous Topic

Next Topic

Connection String

Beginning with FairCom DB V11.2 and FairCom RTG V2, the connection string is in the following format:

jdbc:ctree://<host>[:portnumber]/<dbname>[?param=value[&param=value]...]

The valid values for param are:

  • characterEncoding - Replace encoding with a valid Java encoding name (e.g., US‑ASCII, ISO‑8859-1, UTF‑8, etc.).
  • password
  • User
  • ssl - Values of basic (no peer certificate authentication) or peerAuthentication (server certificate authentication)

    When peerAuthentication is requested, the client’s trust store must contain the server’s certificate as shown in the example below.

  • sock_timeout - specifies a socket timeout in milliseconds.
  • tcpKeepaliveInterval - The default value is 0 (no keepalive). When a value greater than 0 is specified, a tcp client connection requests a TCP level keepalive probe that is sent after the TCP link has been idle for the specified interval in seconds. If the host does not respond to the keepalive probe within 10 seconds, the connection will be treated as broken. This keepalive probe provides periodic activity on the link to help achieve 2 goals.1) prevent network hardware from identifying the connection as idle and silently terminating it. 2) distinguish a broken network link from a server operation that takes a long time to respond (unlike a socket timeout).

    NOTE: tcpKeepaliveInterval requires Java 11, and is not supported on all platforms.

The tutorials use a connection string that is set for the default configuration:

"jdbc:ctree://localhost:6597/ctreeSQL", "ADMIN", "ADMIN"

TLS/SSL Examples

Connection c = getConnection("jdbc:ctree://localhost:6597/ctreeSQL?ssl=basic");

System.setProperty("javax.net.ssl.trustStore","TrustStore.key");

System.setProperty("javax.net.ssl.trustStorePassword","mypassword""");

Connection c = getConnection("jdbc:ctree://localhost:6597/ctreeSQL?ssl=peerAuthentication");

For backward compatibility, the older format ("jdbc:ctree:6597@localhost:ctreeSQL", "ADMIN", "ADMIN") is still supported but should be considered deprecated.

TOCIndex