com.partnersoft.sql
Class SqlDataRecordInsertSink

java.lang.Object
  extended by com.partnersoft.io.DataRecordSink
      extended by com.partnersoft.sql.SqlDataRecordInsertSink

public class SqlDataRecordInsertSink
extends DataRecordSink

DataRecordSink for inserting records into a Sql database.

Copyright 2009 Partner Software, Inc.

Author:
Rich Stepanski

Constructor Summary
SqlDataRecordInsertSink(SqlConnection connection, java.lang.String tableName, boolean closeWhenDone, java.util.List<java.lang.String> fieldNames)
          Creates a new SqlDataRecordInsertSink for inserting records to a given database.
SqlDataRecordInsertSink(SqlConnection connection, java.lang.String tableName, boolean closeWhenDone, java.lang.String... fieldNames)
          Creates a new SqlDataRecordInsertSink for inserting records to a given database.
 
Method Summary
 void closeImp()
           
 void openImp()
           
 void writeImp(java.util.List<java.lang.Object> payload)
           
 void writeImp(Naming<java.lang.Object> payload)
           
 void writeImp(java.lang.Object... payload)
           
 
Methods inherited from class com.partnersoft.io.DataRecordSink
close, getException, getFieldNames, open, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlDataRecordInsertSink

public SqlDataRecordInsertSink(SqlConnection connection,
                               java.lang.String tableName,
                               boolean closeWhenDone,
                               java.util.List<java.lang.String> fieldNames)
Creates a new SqlDataRecordInsertSink for inserting records to a given database.

Parameters:
connection - - SqlConnection for the database to insert to.
fieldNames - - String list of field names to insert, in order.
tableName - - Name of table to insert to.
closeWhenDone - - if true, connection will be closed when close() is called.

SqlDataRecordInsertSink

public SqlDataRecordInsertSink(SqlConnection connection,
                               java.lang.String tableName,
                               boolean closeWhenDone,
                               java.lang.String... fieldNames)
Creates a new SqlDataRecordInsertSink for inserting records to a given database.

Parameters:
connection - - SqlConnection for the database to insert to.
tableName - - Name of table to insert to.
closeWhenDone - - if true, connection will be closed when close() is called.
fieldNames - - String array of field names to insert, in order.
Method Detail

closeImp

public void closeImp()
              throws java.lang.Exception
Specified by:
closeImp in class DataRecordSink
Throws:
java.lang.Exception

openImp

public void openImp()
             throws java.lang.Exception
Specified by:
openImp in class DataRecordSink
Throws:
java.lang.Exception

writeImp

public void writeImp(Naming<java.lang.Object> payload)
              throws java.lang.Exception
Specified by:
writeImp in class DataRecordSink
Throws:
java.lang.Exception

writeImp

public void writeImp(java.lang.Object... payload)
              throws java.lang.Exception
Specified by:
writeImp in class DataRecordSink
Throws:
java.lang.Exception

writeImp

public void writeImp(java.util.List<java.lang.Object> payload)
              throws java.lang.Exception
Specified by:
writeImp in class DataRecordSink
Throws:
java.lang.Exception