The DataSource interface belongs to the javax.sql package and provides an alternative to DriverManager for establishing database connections. It is commonly used in enterprise applications because it supports features such as connection pooling and easier database configuration.
Methods of DataSource Interface
| Methods |
|---|
|
Establishes a connection to the database using the configured data source properties. |
|
Establishes a database connection using the specified username and password. |
|
Returns the |
|
Sets the |
|
Sets the maximum time allowed for establishing a database connection. |
|
Returns the maximum time allowed for establishing a database connection. |
|
Returns the parent logger used by the data source. |
|
Returns an object that implements the specified JDBC interface. |
|
Checks whether the data source supports the specified JDBC interface. |
