Package org.jppf.persistence
Class JPPFDataSource
java.lang.Object
org.jppf.persistence.JPPFDataSource
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource
A non-pooled, non-XA datasource that provides connections using the
DriverManager API.
The JDBC driver and connection information are retrieved from the JPPF configuration, for example:
# Datasource name jppf.datasource.<configId>.name = myDS # JDBC driver class name jppf.datasource.<configId>.driver.class = com.mysql.jdbc.Driver # Database connection user jppf.datasource.<configId>.user = testjppf # Database connection password jppf.datasource.<configId>.password = testjppf # Database connection url jppf.datasource.<configId>.url = jdbc:mysql://localhost:3306/testjppf
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionJPPFDataSource(String user, String pwd, String url, String driverClass) Initialize this datasource.JPPFDataSource(TypedProperties config) Initialize this datasource from the specified configuration properties. -
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
-
JPPFDataSource
Initialize this datasource from the specified configuration properties.- Parameters:
config- the configuration properties from which to get the connection information.- Throws:
SQLException- if any error occurs.
-
JPPFDataSource
Initialize this datasource.- Parameters:
user- database user.pwd- database user password.url- database connection url.driverClass- JDBC driver class name.- Throws:
SQLException- if any error occurs.
-
-
Method Details
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceDataSource- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceDataSource- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceDataSource- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
unwrap
- Specified by:
unwrapin interfaceWrapper- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperForin interfaceWrapper- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-
getConnection
- Specified by:
getConnectionin interfaceDataSource- Throws:
SQLException
-