de.spieleck.app.jacson.source
Class SQLSource
java.lang.Object
de.spieleck.app.jacson.PluginBase
de.spieleck.app.jacson.source.GenericChunkSourceBase
de.spieleck.app.jacson.source.SQLSource
- All Implemented Interfaces:
- ConfigVerify.Acceptor, GenericJacsonChunkSource, JacsonChunkSource, JacsonReporting, JacsonStately
- public class SQLSource
- extends GenericChunkSourceBase
This class is a JacsonSource reading input from a database. It is a
GenericSource so it can be configured.
$Id: SQLSource.java 15 2005-09-28 18:45:04Z pcs $
- Since:
- 0.89
- Author:
- Patrick Carl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QUERY_NODE
public static final java.lang.String QUERY_NODE
- See Also:
- Constant Field Values
JDBC_URL_NODE
public static final java.lang.String JDBC_URL_NODE
- See Also:
- Constant Field Values
JDBC_DRIVER_NODE
public static final java.lang.String JDBC_DRIVER_NODE
- See Also:
- Constant Field Values
USER_NODE
public static final java.lang.String USER_NODE
- See Also:
- Constant Field Values
PASSWORD_NODE
public static final java.lang.String PASSWORD_NODE
- See Also:
- Constant Field Values
READ_MODE_NODE
public static final java.lang.String READ_MODE_NODE
- See Also:
- Constant Field Values
READ_MODE_DEFAULT
public static final java.lang.String READ_MODE_DEFAULT
- See Also:
- Constant Field Values
COLUMN_SEPARATOR_NODE
public static final java.lang.String COLUMN_SEPARATOR_NODE
- See Also:
- Constant Field Values
COLUMN_SEPARATOR_DEFAULT
public static final java.lang.String COLUMN_SEPARATOR_DEFAULT
- See Also:
- Constant Field Values
SQLSource
public SQLSource()
init
public void init(ConfigNode config)
throws JacsonConfigException
- inits this Source using the given config node.
The following settings are used:
- jdbc-driver: the driver to use, make sure it is in your classpath
- jdbc-url: the URL to use for database connection/li>
- query: the query that will be executed/li>
- user: name of the database user (optional)/li>
- password: password of the database user (optional)/li>
- read-mode: defines wether chunks are created from whole lines
(row-mode) or for every column (column-mode), default is row mode
- separator: inserted in chunks in row-mode to separate column valuess/li>
This source needs the corresponding JDBC driver within the classpath.
- Throws:
JacsonConfigException
accept
public boolean accept(ConfigNode node)
message
public java.lang.String message()
nextChunk
public java.lang.String nextChunk()
throws JacsonException
- Description copied from interface:
JacsonChunkSource
- Deliver a sequence of chunks (that is Strings).
- Returns:
- The next String if available, null if sequence is finished.
- Throws:
JacsonException
Copyleft 2002 spieleck.de.