@Beta public final class JdbcConnectionFactory extends Object implements RecyclingSupplier.Factory<Connection>
Constructor and Description |
---|
JdbcConnectionFactory(String driverName,
String url,
Properties props,
int loginTimeoutSeconds) |
JdbcConnectionFactory(String driverName,
String url,
String user,
String password) |
JdbcConnectionFactory(String driverName,
String url,
String user,
String password,
int loginTimeoutSeconds) |
Modifier and Type | Method and Description |
---|---|
Connection |
create()
create the object.
|
void |
dispose(Connection object)
Dispose the object.
|
String |
toString() |
boolean |
validate(Connection object,
Exception e)
Validate the object, return true if valid,
false of throw an Exception with validation detail otherwise.
|
public JdbcConnectionFactory(String driverName, String url, String user, String password)
public JdbcConnectionFactory(String driverName, String url, String user, String password, int loginTimeoutSeconds)
public JdbcConnectionFactory(String driverName, String url, Properties props, int loginTimeoutSeconds)
public Connection create() throws ObjectCreationException
RecyclingSupplier.Factory
create
in interface RecyclingSupplier.Factory<Connection>
ObjectCreationException
- - cannot create object.public void dispose(Connection object) throws ObjectDisposeException
RecyclingSupplier.Factory
dispose
in interface RecyclingSupplier.Factory<Connection>
object
- - object to dispose.ObjectDisposeException
- - cannot dispose object.public boolean validate(Connection object, Exception e) throws SQLException
RecyclingSupplier.Factory
validate
in interface RecyclingSupplier.Factory<Connection>
object
- - object to validate.e
- - exception previously encountered while handling the object.SQLException
Copyright © 2018 SPF4J. All rights reserved.