T
- the type of data model objectpublic class JdbcSourceDriver<T> extends Object implements SourceDriver<T>
SourceDriver
using JDBC.Constructor and Description |
---|
JdbcSourceDriver(JdbcProfile profile,
JdbcScript<T> script,
Connection connection,
T object)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Disposes this object.
|
T |
get()
Gets the current data model object prepared by the
SourceDriver.next() method. |
boolean |
next()
Returns true iff the next data model object exists,
and then the
SourceDriver.get() method returns its object. |
void |
prepare()
Prepares this driver to invoke
SourceDriver.next() method. |
public JdbcSourceDriver(JdbcProfile profile, JdbcScript<T> script, Connection connection, T object)
profile
- the profile of the target databasescript
- the script of this actionconnection
- the connectionobject
- the data model object used as a bufferIllegalArgumentException
- if any parameter is null
public void prepare() throws IOException
SourceDriver
SourceDriver.next()
method.
This method will be invoked before SourceDriver.next()
only once.
This operation can execute only on the same thread as created this object.prepare
in interface SourceDriver<T>
prepare
in interface Preparable
IOException
- if failed to begipublic boolean next() throws IOException
SourceDriver
SourceDriver.get()
method returns its object.
This operation can execute only on the same thread as created this object.next
in interface SourceDriver<T>
true
if the next data model object exists, otherwise false
IOException
- if failed to prepare the next datapublic T get() throws IOException
SourceDriver
SourceDriver.next()
method.
This operation can execute only on the same thread as created this object.get
in interface SourceDriver<T>
IOException
- if failed to prepare the next dataSourceDriver.next()
public void close() throws IOException
SourceDriver
close
in interface SourceDriver<T>
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if failed to connectCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.