T - the type of data model objectpublic class JdbcDrainDriver<T> extends Object implements DrainDriver<T>
DrainDriver using JDBC.| Constructor and Description |
|---|
JdbcDrainDriver(JdbcProfile profile,
JdbcScript<T> script,
Connection connection,
boolean truncateOnPrepare)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Disposes this object.
|
void |
prepare()
Prepares this driver to invoke
DrainDriver.put(Object) method. |
void |
put(T object)
Puts each data model object into the connected resource.
|
public JdbcDrainDriver(JdbcProfile profile, JdbcScript<T> script, Connection connection, boolean truncateOnPrepare)
profile - the profile of the target databasescript - the script of this actionconnection - the connectiontruncateOnPrepare - true to truncate the target table on preparationIllegalArgumentException - if any parameter is nullpublic void prepare()
throws IOException
DrainDriverDrainDriver.put(Object) method.
This method will be invoked before DrainDriver.put(Object) only once.
This operation can execute only on the same thread as created this object.prepare in interface DrainDriver<T>prepare in interface PreparableIOException - if failed to beginpublic void put(T object) throws IOException
DrainDriverput in interface DrainDriver<T>object - the data model object to be putIOException - if failed to put datapublic void close()
throws IOException
DrainDriverclose in interface DrainDriver<T>close in interface Closeableclose in interface AutoCloseableIOException - if failed to connectCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.