Ether Framework
Unified API docs for Ether modules
Loading...
Searching...
No Matches
dev.rafex.ether.jdbc.datasource.SimpleDataSource Class Reference

A simple implementation of DataSource that uses DriverManager to create connections. More...

Inheritance diagram for dev.rafex.ether.jdbc.datasource.SimpleDataSource:
Collaboration diagram for dev.rafex.ether.jdbc.datasource.SimpleDataSource:

Public Member Functions

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ SimpleDataSource() [1/3]

dev.rafex.ether.jdbc.datasource.SimpleDataSource.SimpleDataSource ( final String url)

Creates a new SimpleDataSource with the specified JDBC URL.

Parameters
urlthe JDBC URL of the database
Exceptions
NullPointerExceptionif 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
urlthe JDBC URL of the database
usernamethe database username
passwordthe database password
Exceptions
NullPointerExceptionif 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
urlthe JDBC URL of the database
propertiesthe connection properties
Exceptions
NullPointerExceptionif url is null

Definition at line 82 of file SimpleDataSource.java.

Member Function Documentation

◆ 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
SQLExceptionif 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
usernamethe database username
passwordthe database password
Returns
a database connection
Exceptions
SQLExceptionif a database access error occurs

Definition at line 114 of file SimpleDataSource.java.

◆ getLoginTimeout()

int dev.rafex.ether.jdbc.datasource.SimpleDataSource.getLoginTimeout ( )

Definition at line 134 of file SimpleDataSource.java.

◆ getLogWriter()

PrintWriter dev.rafex.ether.jdbc.datasource.SimpleDataSource.getLogWriter ( )

Definition at line 119 of file SimpleDataSource.java.

◆ getParentLogger()

Logger dev.rafex.ether.jdbc.datasource.SimpleDataSource.getParentLogger ( ) throws SQLFeatureNotSupportedException

Not supported by this implementation.

Returns
nothing, always throws an exception
Exceptions
SQLFeatureNotSupportedExceptionalways

Definition at line 145 of file SimpleDataSource.java.

◆ isWrapperFor()

boolean dev.rafex.ether.jdbc.datasource.SimpleDataSource.isWrapperFor ( final Class<?> iface)

Definition at line 158 of file SimpleDataSource.java.

◆ setLoginTimeout()

void dev.rafex.ether.jdbc.datasource.SimpleDataSource.setLoginTimeout ( final int seconds)

Definition at line 129 of file SimpleDataSource.java.

◆ setLogWriter()

void dev.rafex.ether.jdbc.datasource.SimpleDataSource.setLogWriter ( final PrintWriter out)

Definition at line 124 of file SimpleDataSource.java.


The documentation for this class was generated from the following file: