getOctaviusSession

Establishes a new OctaviusSession using the specified url and properties properties.

Return

An OctaviusSession instance.

Parameters

url

A database url of the form jdbc:subprotocol:subname.

properties

A list of arbitrary string tag/value pairs as connection arguments.


Establishes a new OctaviusSession using the specified properties.

Return

An OctaviusSession instance.

Parameters

properties

Connection arguments encapsulated in OctaviusProperties.


Establishes a new OctaviusSession using the specified url, user, and password.

Return

An OctaviusSession instance.

Parameters

url

A database url of the form jdbc:subprotocol:subname.

user

The database user on whose behalf the connection is being made.

password

The user's password.


Retrieves a new OctaviusSession from this DataSource.

Return

An OctaviusSession instance.

Throws

if the data source would not hand over a connection - which for a pooled one covers a borrow that timed out and a pool that has been closed. Where the pool was restating a failure of the driver's own, that one is raised instead.


Retrieves a new OctaviusSession from this DataSource using the specified credentials.

Per-call credentials are not something every data source implements: HikariCP refuses them outright, its connections having been opened with the credentials the pool was configured with.

Return

An OctaviusSession instance.

Parameters

username

The database user on whose behalf the connection is being made.

pass

The user's password.

Throws

if the data source would not hand over a connection on these terms. Where it was restating a failure of the driver's own, that one is raised instead.


Retrieves a new OctaviusSession from this Connection.

The connection has to reach an OctaviusConnection through unwrap, which a pool's proxy answers for as long as it still stands over one - so a connection already handed back is refused here rather than at the first query.

Return

An OctaviusSession instance.

Parameters

ownsConnection

Whether closing the session should close this connection too. Leave it as it is when the session is what the connection was opened for. Pass false when something else owns the connection and will give it back itself - Spring's DataSourceUtils, a pool borrowed from by hand - and closing the session then undoes the state it left behind and stops there, rather than returning a connection its owner still believes it holds.

Throws

if a session could not be opened over this connection.