Top Description Fields Constructors Methods
com.ziclix.python.sql.pipe.db

public Class DBSource

extends BaseDB
implements Source
Class Inheritance
All Implemented Interfaces
com.ziclix.python.sql.pipe.Source
Imports
com.ziclix.python.sql.PyConnection, com.ziclix.python.sql.pipe.Source, org.python.core.Py, .PyObject, .PyTuple

A database source. Given a PyConnection and information about the query, produce the data.
Author
brian zimmer

Field Summary

Modifier and TypeField and Description
protected PyObject
include

Field params, include

protected PyObject
params

Field params, include

protected boolean
sentHeader

Field sentHeader

protected String
sql

Field sql

Inherited from com.ziclix.python.sql.pipe.db.BaseDB:
connectioncursordataHandlertableName

Constructor Summary

AccessConstructor and Description
public
DBSource(PyConnection
the database connection
connection
,
Class<T>
a custom DataHandler for the cursor, can be None
dataHandler
,
String
the table in question on the source database
tableName
,
String
an optional where clause, defaults to '(1=1)' if null
where
,
PyObject
the columns to be queried from the source, '*' if None
include
,
PyObject
optional params to substituted in the where clause
params
)

Constructor for handling the generation of data.

Method Summary

Modifier and TypeMethod and Description
protected String
createSql(String where)

Create the sql string given the where clause.

public void
end()

Implements com.ziclix.python.sql.pipe.Source.end.

Close the cursor.

public PyObject
next()

Implements com.ziclix.python.sql.pipe.Source.next.

Return the next row in the result set.

public void
Inherited from com.ziclix.python.sql.pipe.db.BaseDB:
cursor

Field Detail

includeback to summary
protected PyObject include

Field params, include

paramsback to summary
protected PyObject params

Field params, include

sentHeaderback to summary
protected boolean sentHeader

Field sentHeader

sqlback to summary
protected String sql

Field sql

Constructor Detail

DBSourceback to summary
public DBSource(PyConnection connection, Class<T> dataHandler, String tableName, String where, PyObject include, PyObject params)

Constructor for handling the generation of data.

Parameters
connection:PyConnection

the database connection

dataHandler:Class<T>

a custom DataHandler for the cursor, can be None

tableName:String

the table in question on the source database

where:String

an optional where clause, defaults to '(1=1)' if null

include:PyObject

the columns to be queried from the source, '*' if None

params:PyObject

optional params to substituted in the where clause

Method Detail

createSqlback to summary
protected String createSql(String where)

Create the sql string given the where clause.

endback to summary
public void end()

Implements com.ziclix.python.sql.pipe.Source.end.

Close the cursor.

nextback to summary
public PyObject next()

Implements com.ziclix.python.sql.pipe.Source.next.

Return the next row in the result set. The first row returned will be column information.

startback to summary
public void start()

Implements com.ziclix.python.sql.pipe.Source.start.

Method start