Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.knowgate.datacopy
Class CopyRegisters

    java.lang.Object
      com.knowgate.datacopy.CopyRegisters

    public class CopyRegisters

extends java.lang.Object

Field Summary
`static int` | `FETCH_SIZE`

Constructor Summary
`CopyRegisters()`
`CopyRegisters(java.lang.String schema, java.lang.String catalog)`

Method Summary
`int` | `append(java.sql.Connection oOrigin, java.sql.Connection oTarget, java.lang.String sOriginTable, java.lang.String sTargetTable, java.lang.String sWhere)` Append registers from origin table to target table.
`java.lang.Object` | `cast(java.lang.Object oOrigin, int iOriginType, int iTargetType)`
`int` | `insert(java.sql.Connection oOrigin, java.sql.Connection oTarget, java.lang.String sOriginTable, java.lang.String sTargetTable, java.lang.String sWhere)` Insert registers from origin table to target table.
`int` | `replace(java.sql.Connection oOrigin, java.sql.Connection oTarget, java.lang.String sOriginTable, java.lang.String sTargetTable, java.lang.String sWhere)` Replace registers from origin table to target table.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### FETCH_SIZE

    public static int FETCH_SIZE

Constructor Detail

### CopyRegisters

    public CopyRegisters()

### CopyRegisters

    public CopyRegisters(java.lang.String schema,
                         java.lang.String catalog)

Method Detail

### cast

    public java.lang.Object cast(java.lang.Object oOrigin,
                                 int iOriginType,
                                 int iTargetType)

### insert

    public int insert(java.sql.Connection oOrigin,
                      java.sql.Connection oTarget,
                      java.lang.String sOriginTable,
                      java.lang.String sTargetTable,
                      java.lang.String sWhere)
               throws java.sql.SQLException

  Insert registers from origin table to target table.

  Parameters:
    `oOrigin` - JDBC Origin Connection
    `oTarget` - JDBC Target Connection
    `sOriginTable` - Origin Table Name
    `sTargetTable` - Target Table Name
    `sWhere` - SQL filter clause to be applied at origin fron retrieving only a register subset
  Returns:
    Number of inserted rows
  Throws:
    `java.sql.SQLException` - A duplicated primary key exception is thrown if any inserted register already exists at target table

### replace

    public int replace(java.sql.Connection oOrigin,
                       java.sql.Connection oTarget,
                       java.lang.String sOriginTable,
                       java.lang.String sTargetTable,
                       java.lang.String sWhere)
                throws java.sql.SQLException

  Replace registers from origin table to target table.

  Registers not already present at target table will not be inserted from origin table

  Parameters:
    `oOrigin` - JDBC Origin Connection
    `oTarget` - JDBC Target Connection
    `sOriginTable` - Origin Table Name
    `sTargetTable` - Target Table Name
    `sWhere` - SQL filter clause to be applied at origin fron retrieving only a register subset
  Returns:
    Number of replaced rows
  Throws:
    `java.sql.SQLException`

### append

    public int append(java.sql.Connection oOrigin,
                      java.sql.Connection oTarget,
                      java.lang.String sOriginTable,
                      java.lang.String sTargetTable,
                      java.lang.String sWhere)
               throws java.sql.SQLException

  Append registers from origin table to target table.

  Registers not present at target table will be inserted from origin table and those present will be updated

  Parameters:
    `oOrigin` - JDBC Origin Connection
    `oTarget` - JDBC Target Connection
    `sOriginTable` - Origin Table Name
    `sTargetTable` - Target Table Name
    `sWhere` - SQL filter clause to be applied at origin fron retrieving only a register subset
  Returns:
    Number of replaced rows
  Throws:
    `java.sql.SQLException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD