java.lang.Object
org.litebridgedb.orm.tx.LitebridgeDriverManagerDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
A simple
DataSource implementation that utilises DriverManager to create connections.
It provides basic functionality for connection management by encapsulating a URL,
username, and password to connect to a database.
This class implements the DataSource interface and delegates connection
retrieval to the DriverManager class, making it suitable for lightweight
database connection management.
Thread safety is not guaranteed. Ensure proper synchronisation for concurrent access.
-
Constructor Summary
ConstructorsConstructorDescriptionLitebridgeDriverManagerDataSource(String url, String username, String password) -
Method Summary
Modifier and TypeMethodDescriptiongetConnection(String username, String password) intbooleanisWrapperFor(Class<?> iface) voidsetLoginTimeout(int seconds) voidsetLogWriter(PrintWriter out) <T> TMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilderMethods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
LitebridgeDriverManagerDataSource
-
-
Method Details
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds) - Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper
-