public class SQLPersisterService
extends java.lang.Object
CREATE TABLE oddjob(
path VARCHAR(128),
id VARCHAR(32),
job BLOB,
CONSTRAINT oddjob_pk PRIMARY KEY (path, id))
<oddjob id="this"> <job> <sequential> <jobs> <sql-persister-service id="sql-persister"> <connection> <connection driver="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:mem:test" username="sa"/> </connection> </sql-persister-service> <oddjob id="oj" file="${this.dir}/SQLPersisterInner.xml"> <persister> <value value="${sql-persister.persister(test)}"/> </persister> </oddjob> <stop job="${sql-persister}"/> </jobs> </sequential> </job> </oddjob>Note that because this is a service, it must be stopped once the inner Oddjob has completed it's work. In an Oddjob that was running continually this would not be necessary.
Constructor and Description |
---|
SQLPersisterService() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
OddjobPersister |
getPersister(java.lang.String path) |
SQLSerializationFactory |
getSerializationFactory() |
void |
setConnection(java.sql.Connection connection)
Set the connection.
|
void |
setName(java.lang.String name) |
void |
setSerializationFactory(SQLSerializationFactory serializationFactory) |
void |
start() |
void |
stop() |
java.lang.String |
toString() |
public void start() throws java.sql.SQLException
java.sql.SQLException
public void stop() throws java.sql.SQLException
java.sql.SQLException
public void setConnection(java.sql.Connection connection) throws java.sql.SQLException
connection
- The connection.java.sql.SQLException
public java.lang.String getName()
public void setName(java.lang.String name)
public SQLSerializationFactory getSerializationFactory()
public void setSerializationFactory(SQLSerializationFactory serializationFactory)
public OddjobPersister getPersister(java.lang.String path)
Property: persister
Description: The persister.
Required: R/O.
public java.lang.String toString()
toString
in class java.lang.Object