CommonDataSource
OracleConnectionPoolDataSource
, OracleConnectionPoolDataSource
, OracleDataSource
, OracleDataSource
, OracleXADataSource
, OracleXADataSource
OracleConnectionPoolDataSource
, OracleConnectionPoolDataSourceImpl
, OracleDataSource
, OracleDataSourceImpl
, OracleOCIConnectionPool
, OracleXADataSource
, OracleXADataSource
, OracleXADataSourceImpl
public interface OracleCommonDataSource extends CommonDataSource
OracleDataSource
, OracleXADataSource
and
OracleConnectionPoolDataSource
and defines the Oracle extensions
to the standard JDBC interface CommonDataSource
.Modifier and Type | Method | Description |
---|---|---|
default OracleShardingKeyBuilder |
createShardingKeyBuilder() |
Creates a new
OracleShardingKeyBuilder instance. |
Properties |
getConnectionProperties() |
Gets the Connection Properties that are set in the datasource
Returns the current Properties set in the datasource.
|
String |
getDatabaseName() |
Gets the name of the database set on this DataSource instance.
|
String |
getDataSourceName() |
Gets the datasource name for this instance if set.
|
String |
getDescription() |
Get the Desciption of this data source.
|
boolean |
getExplicitCachingEnabled() |
Returns the current value of the explicitCachingEnabled property.
|
boolean |
getImplicitCachingEnabled() |
getImplicitCachingEnabled
Returns the current value of the implicitCachingEnabled property.
|
int |
getMaxStatements() |
Returns the current value of the maxStatements property.
|
String |
getNetworkProtocol() |
Gets the network protocol set on the datasource.
|
int |
getPortNumber() |
Gets the port number on which server is listening for requests.
|
String |
getRoleName() |
Gets the data source role name.
|
String |
getServerName() |
Gets the name of the server on which database is running.
|
String |
getURL() |
Gets the URL for this datasource.
|
String |
getUser() |
Gets the user name for this datasource.
|
void |
setConnectionProperties(Properties value) |
Sets the Connection Properties for the datasource
|
void |
setDatabaseName(String dbname) |
Sets the name of a particular database on a server.
|
void |
setDataSourceName(String dsname) |
Sets the datasource name.
|
void |
setDescription(String des) |
Sets the Description for this data source instance.
|
void |
setExplicitCachingEnabled(boolean cache) |
Sets the value of the explicitCachingEnabled property, which
enables or disables the explicit cache.
|
void |
setImplicitCachingEnabled(boolean cache) |
Sets the value of the implicitCachingEnabled property, which
enables or disables the implicit statement cache.
|
void |
setMaxStatements(int max) |
Specifies the value of the maxStatements property.
|
void |
setNetworkProtocol(String np) |
Sets the network protocol for the connections.
|
void |
setPassword(String pd) |
Sets the password with which connections have to be obtained.
|
void |
setPortNumber(int pn) |
Sets the port number where a server is listening for requests.
|
void |
setRoleName(String roleName) |
Sets the data source role name.
|
void |
setServerName(String sn) |
Sets the name of the Server on which database is running.
|
void |
setSSLContext(SSLContext sslContext) |
Specifies a
SSLContext to use as a factory for
SSLEngine objects that carry out the TLS
protocol. |
void |
setTokenSupplier(java.util.function.Supplier<? extends AccessToken> tokenSupplier) |
Sets a supplier function that generates an access token when creating a
connection with this
DataSource . |
void |
setURL(String url) |
Sets the URL from which connections have to be obtained.
|
void |
setUser(String userName) |
Set the user name with which connections have to be obtained.
|
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
default OracleShardingKeyBuilder createShardingKeyBuilder() throws SQLException
OracleShardingKeyBuilder
instance.createShardingKeyBuilder
in interface CommonDataSource
SQLException
- if an error occurs creating the builderOracleShardingKeyBuilder
void setDataSourceName(String dsname) throws SQLException
dsname
- DataSource Name to be set.SQLException
String getDataSourceName()
String getDatabaseName()
void setDatabaseName(String dbname) throws SQLException
If URL is set, this property will be ignored.
dsname
- database name to be set.SQLException
void setServerName(String sn) throws SQLException
sn
- server/host name to be set.SQLException
String getServerName()
void setURL(String url) throws SQLException
url
- URL to be set.SQLException
String getURL() throws SQLException
SQLException
void setUser(String userName) throws SQLException
user
- Username to be set.SQLException
String getUser()
void setPassword(String pd) throws SQLException
pd
- Passowrd to be set.SQLException
String getDescription()
void setDescription(String des) throws SQLException
des
- Desciption to be set.SQLException
String getNetworkProtocol()
void setNetworkProtocol(String np) throws SQLException
np
- set the network protocol to be used.SQLException
void setPortNumber(int pn) throws SQLException
pn
- port number on which server is listeningSQLException
int getPortNumber()
void setConnectionProperties(Properties value) throws SQLException
The argument to this method is a Properties object. This properties object is used to create the connections returned by the receiver. The keys and values are Strings. The keys, values, and their meanings are defined in oracle.jdbc.OracleConnection.
value
- a Properties object with the desired connection property names
and values.SQLException
OracleConnection
Properties getConnectionProperties() throws SQLException
SQLException
void setMaxStatements(int max) throws SQLException
max
- Requested size of the cache. If the existing cache size
is less than max, statements will be purged to reduce the
size.SQLException
- if max < 0int getMaxStatements() throws SQLException
SQLException
void setImplicitCachingEnabled(boolean cache) throws SQLException
cache
- If true, then implicit caching is enabled. If false,
then any existing statement is purged and the implicit
caching is disabled.SQLException
boolean getImplicitCachingEnabled() throws SQLException
SQLException
void setExplicitCachingEnabled(boolean cache) throws SQLException
cache
- If true, then explicit caching is enabled. If false,
then any existing statement is purged and the explicit
caching is disabled.SQLException
- if called on a logical connection.boolean getExplicitCachingEnabled() throws SQLException
SQLException
void setRoleName(String roleName) throws SQLException
roleName
- data source role name to be set.SQLException
String getRoleName()
void setSSLContext(SSLContext sslContext) throws SQLException
SSLContext
to use as a factory for
SSLEngine objects that carry out the TLS
protocol.
The SSLContext must be initialized before establishing a connection to the data source. The certificates specified by that initialization will be used in place of any connection properties that would otherwise have specified certificates, such as key store and trust store property values.
Specifying a null value will clear any non-null value that may have been set previously, causing this data source to behave as if this method had never been called at all.
sslContext
- An SSLContext to use as an SSLEngine factory.SQLException
- if this data source is incompatible with the
specified SSLContext.void setTokenSupplier(java.util.function.Supplier<? extends AccessToken> tokenSupplier)
Sets a supplier function that generates an access token when creating a
connection with this DataSource
. The supplier function
is invoked each time this DataSource
creates a
connection. Instances of AccessToken
that are output by the
supplier must represent a token type that is supported by Oracle Database
for client authentication. The supplier must be thread safe.
It is invalid to configure this DataSource
with both a token
supplier and with a user name or password. If invocations of
setUser(String)
, setPassword(String)
,
setConnectionProperties(java.util.Properties)
, or
#setConnectionProperty(String, String)
have configured this
DataSource
with a user name or password, and an invocation of
this method has also configured a token supplier, then a
SQLException
indicating an invalid configuration is thrown when
creating a connection with this datasource.
Note that AccessToken.createJsonWebTokenCache(Supplier)
can be
called to create a thread safe Supplier
that caches tokens from
a user defined Supplier
.
tokenSupplier
- Token supplying function. Not null
.NullPointerException
- If the tokenSupplier
is null.