OctaviusDataSource
Implementation of the standard JDBC DataSource interface for the Octavius driver.
This class serves as a factory for obtaining connections to a PostgreSQL database. It encapsulates the configuration properties required to establish a connection, such as the server URL, credentials, and SSL settings.
Configuration properties can be set either via the url property or individually using the respective accessor properties. Every field of OctaviusProperties has an accessor here, so a pool that configures a DataSource through JavaBean setters - HikariCP's addDataSourceProperty, for one - can reach all of them; anything else goes through setProperty, including server startup parameters.
Properties
The name this connection reports to the server, visible in pg_stat_activity. Unset, the driver's own name - Octavius Driver - is sent instead.
Seconds allowed for a cancel request, covering both its connect and its reads.
How hard to insist that authentication be bound to the TLS channel. Defaults to ChannelBinding.PREFER.
The name of the database to connect to.
Starting size, in bytes, of the per-connection parameter buffer.
Whether a traced statement carries the values bound to it, rather than only how many there were. Off unless set, and effective only at trace.
Largest row, in bytes, kept in the reusable row buffer.
Cap for the per-connection parameter buffer; it shrinks back to initialParameterWriterCapacity after a query that exceeded it.
Fully-qualified class name of a NoticeHandler for server notices.
Capacity of the LISTEN/NOTIFY buffer.
The port number on which the PostgreSQL server is listening. Defaults to 5432.
The hostname or IP address of the PostgreSQL server.
Seconds to wait on a socket read before failing. 0 waits forever.
The path to the client private key file for SSL authentication. PKCS#8 in PEM form, encrypted or not - sslpassword opens an encrypted one - and RSA or EC alike, the algorithm being read off sslcert rather than assumed.
Decrypts sslkey where that key is encrypted - a PEM file opening on BEGIN ENCRYPTED PRIVATE KEY. An unencrypted key ignores it; an encrypted one without it is refused, naming this property.
The path to the root certificate file for verifying the server's certificate. Optional: left unset, verification under verify-ca and above uses the JVM's default trust store.
Functions
Retrieves a new OctaviusSession from this DataSource.
Retrieves a new OctaviusSession from this DataSource using the specified credentials.
Sets any property this class does not expose directly, by the same name a JDBC URL would use. Anything the driver does not recognise is sent to the server as a startup parameter, which is what makes this the programmatic route to search_path, statement_timeout and friends - application_name has applicationName and needs no detour.
Unwraps this DataSource to an instance of the specified type T.
Unwraps this DataSource to its underlying OctaviusDataSource instance.