A simple implementation of DataSource that uses DriverManager to create connections.
More...
|
| Connection | getConnection () throws SQLException |
| | Retrieves a database connection using the configured URL and properties.
|
| Connection | getConnection (final String username, final String password) throws SQLException |
| | Retrieves a database connection using the specified username and password.
|
| int | getLoginTimeout () |
| PrintWriter | getLogWriter () |
| Logger | getParentLogger () throws SQLFeatureNotSupportedException |
| | Not supported by this implementation.
|
| boolean | isWrapperFor (final Class<?> iface) |
| void | setLoginTimeout (final int seconds) |
| void | setLogWriter (final PrintWriter out) |
| | SimpleDataSource (final String url) |
| | Creates a new SimpleDataSource with the specified JDBC URL.
|
| | SimpleDataSource (final String url, final Properties properties) |
| | Creates a new SimpleDataSource with the specified JDBC URL and properties.
|
| | SimpleDataSource (final String url, final String username, final String password) |
| | Creates a new SimpleDataSource with the specified JDBC URL, username, and password.
|
A simple implementation of DataSource that uses DriverManager to create connections.
This implementation is suitable for applications that need a straightforward way to obtain database connections without complex connection pooling.
Definition at line 46 of file SimpleDataSource.java.
◆ SimpleDataSource() [1/3]
| dev.rafex.ether.jdbc.datasource.SimpleDataSource.SimpleDataSource |
( |
final String | url | ) |
|
Creates a new SimpleDataSource with the specified JDBC URL.
- Parameters
-
| url | the JDBC URL of the database |
- Exceptions
-
| NullPointerException | if url is null |
Definition at line 59 of file SimpleDataSource.java.
◆ SimpleDataSource() [2/3]
| dev.rafex.ether.jdbc.datasource.SimpleDataSource.SimpleDataSource |
( |
final String | url, |
|
|
final String | username, |
|
|
final String | password ) |
Creates a new SimpleDataSource with the specified JDBC URL, username, and password.
- Parameters
-
| url | the JDBC URL of the database |
| username | the database username |
| password | the database password |
- Exceptions
-
| NullPointerException | if url is null |
Definition at line 71 of file SimpleDataSource.java.
◆ SimpleDataSource() [3/3]
| dev.rafex.ether.jdbc.datasource.SimpleDataSource.SimpleDataSource |
( |
final String | url, |
|
|
final Properties | properties ) |
Creates a new SimpleDataSource with the specified JDBC URL and properties.
- Parameters
-
| url | the JDBC URL of the database |
| properties | the connection properties |
- Exceptions
-
| NullPointerException | if url is null |
Definition at line 82 of file SimpleDataSource.java.
◆ getConnection() [1/2]
| Connection dev.rafex.ether.jdbc.datasource.SimpleDataSource.getConnection |
( |
| ) |
throws SQLException |
Retrieves a database connection using the configured URL and properties.
- Returns
- a database connection
- Exceptions
-
| SQLException | if a database access error occurs |
Definition at line 97 of file SimpleDataSource.java.
◆ getConnection() [2/2]
| Connection dev.rafex.ether.jdbc.datasource.SimpleDataSource.getConnection |
( |
final String | username, |
|
|
final String | password ) throws SQLException |
Retrieves a database connection using the specified username and password.
- Parameters
-
| username | the database username |
| password | the database password |
- Returns
- a database connection
- Exceptions
-
| SQLException | if a database access error occurs |
Definition at line 114 of file SimpleDataSource.java.
◆ getLoginTimeout()
| int dev.rafex.ether.jdbc.datasource.SimpleDataSource.getLoginTimeout |
( |
| ) |
|
◆ getLogWriter()
| PrintWriter dev.rafex.ether.jdbc.datasource.SimpleDataSource.getLogWriter |
( |
| ) |
|
◆ getParentLogger()
| Logger dev.rafex.ether.jdbc.datasource.SimpleDataSource.getParentLogger |
( |
| ) |
throws SQLFeatureNotSupportedException |
Not supported by this implementation.
- Returns
- nothing, always throws an exception
- Exceptions
-
| SQLFeatureNotSupportedException | always |
Definition at line 145 of file SimpleDataSource.java.
◆ isWrapperFor()
| boolean dev.rafex.ether.jdbc.datasource.SimpleDataSource.isWrapperFor |
( |
final Class<?> | iface | ) |
|
◆ setLoginTimeout()
| void dev.rafex.ether.jdbc.datasource.SimpleDataSource.setLoginTimeout |
( |
final int | seconds | ) |
|
◆ setLogWriter()
| void dev.rafex.ether.jdbc.datasource.SimpleDataSource.setLogWriter |
( |
final PrintWriter | out | ) |
|
The documentation for this class was generated from the following file: