Top Description Fields Constructors Methods
com.ziclix.python.sql.util

public Class BCP

Additional top-level class in compilation unit: BCPFunc.

extends PyObject
implements ClassDictInit, Traverseproc
Class Inheritance
All Implemented Interfaces
org.python.core.Traverseproc, org.python.core.ClassDictInit
Imports
org.python.core.ClassDictInit, .Py, .PyBuiltinMethodSet, .PyClass, .PyList, .PyObject, .PyString, .Traverseproc, .Visitproc, com.ziclix.python.sql.PyConnection, .zxJDBC, com.ziclix.python.sql.pipe.Pipe, com.ziclix.python.sql.pipe.db.DBSink, .DBSource

A class to perform efficient Bulk CoPy of database tables.

Field Summary

Modifier and TypeField and Description
protected static PyList
__members__

Field __members__

protected static PyList
__methods__

Field __methods__

protected int
batchsize

Field batchsize, queuesize

protected Class<T>
destDH

Field sourceDH, destDH

protected PyConnection
destination

Field source, destination

protected int
queuesize

Field batchsize, queuesize

protected PyConnection
source

Field source, destination

protected Class<T>
sourceDH

Field sourceDH, destDH

Inherited from org.python.core.PyObject:
attributesgcMonitorGlobalobjtypeTYPE

Constructor Summary

AccessConstructor and Description
public
BCP(PyConnection source, PyConnection destination)

The source connection will produce the rows while the destination connection will consume the rows and coerce as necessary for the destination database.

public
BCP(PyConnection source, PyConnection destination, int
used to batch the inserts on the destination
batchsize
)

The source connection will produce the rows while the destination connection will consume the rows and coerce as necessary for the destination database.

Method Summary

Modifier and TypeMethod and Description
public PyObject

Returns:

the attribute for the given name
__findattr_ex__
(String name)

Overrides org.python.core.PyObject.__findattr_ex__.

Gets the value of the attribute name.

public void
__setattr__(String name, PyObject value)

Overrides org.python.core.PyObject.__setattr__.

Sets the attribute name to value.

protected PyObject

Returns:

the count of the total number of rows bulk copied, -1 if the query returned no rows
bcp
(String
the table in question on the source database
fromTable
,
String
an optional where clause, defaults to '(1=1)' if null
where
,
PyObject
optional params to substituted in the where clause
params
,
PyObject
the columns to be queried from the source, '*' if None
include
,
PyObject
the columns to be excluded from insertion on the destination, all if None
exclude
,
String
if non-null, the table in the destination db, otherwise the same table name as the source
toTable
,
PyObject
the optional bindings for the destination, this allows morphing of types during the copy
bindings
)

Bulkcopy data from one database to another.

public static void
classDictInit(PyObject dict)

Initializes the object's namespace.

public boolean
public String

Returns:

a string representation of the object.
toString
()

Overrides org.python.core.PyObject.toString.

String representation of the object.

public int
traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from org.python.core.PyObject:
__abs____add____and____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____cmp____coerce____coerce_ex____complex____contains____delattr____delattr____delete____delitem____delitem____delslice____delslice____dir____div____divmod____ensure_finalizer____eq____findattr____findattr____finditem____finditem____finditem____float____floordiv____format____ge____get____getattr____getattr____getitem____getitem____getnewargs____getslice____getslice____gt____hash____hex____iadd____iand____idiv____idivmod____ifloordiv____ilshift____imod____imul____index____int____invert____ior____ipow____irshift____isub____iter____iternext____itruediv____ixor____le____len____long____lshift____lt____mod____mul____ne____neg____nonzero____not____oct____or____pos____pow____pow____radd____rand____rawdir____rdiv____rdivmod____reduce____reduce_ex____reduce_ex____repr____rfloordiv____rlshift____rmod____rmul____ror____rpow____rrshift____rshift____rsub____rtruediv____rxor____set____setattr____setitem____setitem____setitem____setslice____setslice____str____sub____tojava____truediv____trunc____unicode____xor___add_and_callextra_cmp_div_divmod_doget_doget_doset_eq_floordiv_ge_gt_iadd_iand_idiv_idivmod_ifloordiv_ilshift_imod_imul_in_ior_ipow_irshift_is_isnot_isub_itruediv_ixor_jcall_jcallexc_jthrow_le_lshift_lt_mod_mul_ne_notin_or_pow_rshift_sub_truediv_unsupportedop_xoradaptToCoerceTupleasDoubleasIndexasIndexasIntasIntasIterableasLongasLongasNameasNameasStringasStringasStringOrNullasStringOrNullbit_lengthconjugatedelDictdelTypedispatch__init__equalsfastGetClassfastGetDictfinalizegetDictgetJavaProxygetTypehashCodeimpAttrimplementsDescrDeleteimplementsDescrGetimplementsDescrSetinvokeinvokeinvokeinvokeinvokeinvokeisCallableisDataDescrisIndexisIntegerisMappingTypeisNumberTypeisSequenceTypemergeClassDictmergeDictAttrmergeListAttrnoAttributeErrorobject___subclasshook__readonlyAttributeErrorrunsupportedopMessagesetDictsetTypeunsupportedopMessage

Field Detail

__members__back to summary
protected static PyList __members__

Field __members__

__methods__back to summary
protected static PyList __methods__

Field __methods__

batchsizeback to summary
protected int batchsize

Field batchsize, queuesize

destDHback to summary
protected Class<T> destDH

Field sourceDH, destDH

destinationback to summary
protected PyConnection destination

Field source, destination

queuesizeback to summary
protected int queuesize

Field batchsize, queuesize

sourceback to summary
protected PyConnection source

Field source, destination

sourceDHback to summary
protected Class<T> sourceDH

Field sourceDH, destDH

Constructor Detail

BCPback to summary
public BCP(PyConnection source, PyConnection destination)

The source connection will produce the rows while the destination connection will consume the rows and coerce as necessary for the destination database.

BCPback to summary
public BCP(PyConnection source, PyConnection destination, int batchsize)

The source connection will produce the rows while the destination connection will consume the rows and coerce as necessary for the destination database.

Parameters
batchsize:int

used to batch the inserts on the destination

Method Detail

__findattr_ex__back to summary
public PyObject __findattr_ex__(String name)

Overrides org.python.core.PyObject.__findattr_ex__.

Gets the value of the attribute name.

Returns:PyObject

the attribute for the given name

Annotations
@Override

__setattr__back to summary
public void __setattr__(String name, PyObject value)

Overrides org.python.core.PyObject.__setattr__.

Sets the attribute name to value.

Annotations
@Override
bcpback to summary
protected PyObject bcp(String fromTable, String where, PyObject params, PyObject include, PyObject exclude, String toTable, PyObject bindings)

Bulkcopy data from one database to another.

Parameters
fromTable:String

the table in question on the source database

where:String

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

params:PyObject

optional params to substituted in the where clause

include:PyObject

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

exclude:PyObject

the columns to be excluded from insertion on the destination, all if None

toTable:String

if non-null, the table in the destination db, otherwise the same table name as the source

bindings:PyObject

the optional bindings for the destination, this allows morphing of types during the copy

Returns:PyObject

the count of the total number of rows bulk copied, -1 if the query returned no rows

classDictInitback to summary
public static void classDictInit(PyObject dict)

Initializes the object's namespace.

refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob)

Implements org.python.core.Traverseproc.refersDirectlyTo.

Doc from org.python.core.Traverseproc.refersDirectlyTo.

Optional operation. Should only be implemented if it is more efficient than calling traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.python.core.PyObject.toString.

String representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override

traverseback to summary
public int traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Doc from org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc#visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc#visit(PyObject, Object) must not be called with a null PyObject-argument.

Annotations
@Override