JavaScript is disabled on your browser.
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
Modifier and Type
Method and Description
java.lang.String
getCatalog ()
Return the database catalog to be applied to each Connection, if any.
java.sql.Connection
getConnection ()
This implementation delegates to getConnectionFromDriver
,
using the default username and password of this DataSource.
java.sql.Connection
getConnection (java.lang.String username,
java.lang.String password)
This implementation delegates to getConnectionFromDriver
,
using the given username and password.
protected abstract java.sql.Connection
getConnectionFromDriver (java.util.Properties props)
Obtain a Connection using the given properties.
protected java.sql.Connection
getConnectionFromDriver (java.lang.String username,
java.lang.String password)
Build properties for the Driver, including the given username and password (if any),
and obtain a corresponding Connection.
java.util.Properties
getConnectionProperties ()
Return the connection properties to be passed to the Driver, if any.
java.lang.String
getPassword ()
Return the JDBC password to use for connecting through the Driver.
java.lang.String
getSchema ()
Return the database schema to be applied to each Connection, if any.
java.lang.String
getUrl ()
Return the JDBC URL to use for connecting through the Driver.
java.lang.String
getUsername ()
Return the JDBC username to use for connecting through the Driver.
void
setCatalog (java.lang.String catalog)
Specify a database catalog to be applied to each Connection.
void
setConnectionProperties (java.util.Properties connectionProperties)
Specify arbitrary connection properties as key/value pairs,
to be passed to the Driver.
void
setPassword (java.lang.String password)
Set the JDBC password to use for connecting through the Driver.
void
setSchema (java.lang.String schema)
Specify a database schema to be applied to each Connection.
void
setUrl (java.lang.String url)
Set the JDBC URL to use for connecting through the Driver.
void
setUsername (java.lang.String username)
Set the JDBC username to use for connecting through the Driver.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method Detail
getCatalog
@Nullable
public java.lang.String getCatalog()
Return the database catalog to be applied to each Connection, if any.
Since:
4.3.2
getSchema
@Nullable
public java.lang.String getSchema()
Return the database schema to be applied to each Connection, if any.
Since:
4.3.2
getConnectionProperties
@Nullable
public java.util.Properties getConnectionProperties()
Return the connection properties to be passed to the Driver, if any.
getConnection
public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
This implementation delegates to getConnectionFromDriver
,
using the given username and password.
Throws:
java.sql.SQLException
See Also:
getConnectionFromDriver(String, String)
getConnectionFromDriver
protected java.sql.Connection getConnectionFromDriver(@Nullable
java.lang.String username,
@Nullable
java.lang.String password)
throws java.sql.SQLException
Build properties for the Driver, including the given username and password (if any),
and obtain a corresponding Connection.
Parameters:
username
- the name of the user
password
- the password to use
Returns:
the obtained Connection
Throws:
java.sql.SQLException
- in case of failure
See Also:
Driver.connect(String, java.util.Properties)