Class DefaultDataSource
java.lang.Object
org.apache.log.output.db.DefaultDataSource
- All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource
A basic datasource that doesn't do any pooling but just wraps
around default mechanisms.
- Author:
- Peter Donald
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate PrintWriterprivate final Stringprivate final Stringprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAttempt to establish a database connection.getConnection(String username, String password) Attempt to establish a database connection.intGets the maximum time in seconds that this data source can wait while attempting to connect to a database.Get the log writer for this data source.booleanisWrapperFor(Class<?> iface) voidsetLoginTimeout(int loginTimeout) Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.voidsetLogWriter(PrintWriter logWriter) <T> TMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CommonDataSource
createShardingKeyBuilderMethods inherited from interface DataSource
createConnectionBuilder
-
Field Details
-
m_username
-
m_password
-
m_url
-
m_logWriter
-
m_loginTimeout
private int m_loginTimeout
-
-
Constructor Details
-
DefaultDataSource
-
-
Method Details
-
getConnection
Attempt to establish a database connection.- Specified by:
getConnectionin interfaceDataSource- Returns:
- the Connection
- Throws:
SQLException
-
getConnection
Attempt to establish a database connection.- Specified by:
getConnectionin interfaceDataSource- Returns:
- the Connection
- Throws:
SQLException
-
getLoginTimeout
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Returns:
- the login time
- Throws:
SQLException
-
getLogWriter
Get the log writer for this data source.- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Returns:
- the LogWriter
- Throws:
SQLException
-
setLoginTimeout
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Parameters:
loginTimeout- the loging timeout in seconds- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper
-
unwrap
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource
-