Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-02


com.sigmadynamics.server.DataServices.DatabaseProvider
Interface TableInserter

All Known Subinterfaces:
ManualFlushTableInserter

public interface TableInserter

Interface that provides the functionality to insert data into a relational table.


Method Summary
 void close()
          close the TableInserter object.
 void flush()
          flush the batched insert to the database.
 void insert()
          insert data into a database.
 boolean isThrottling()
          Returns the throttling mode.
 void put(int column, byte[] value)
          provides data to be inserted into a column.
 void put(int column, double value)
          provides data to be inserted into a column.
 void put(int column, java.io.InputStream value, int length)
          provides data to be inserted into a column.
 void put(int column, long value)
          provides data to be inserted into a column.
 void put(int column, java.lang.String value)
          provides data to be inserted into a column.
 void putDate(int column, long value)
          Provides data to be inserted into a DATE, TIME or TIMESTAMP column.
 void putDate(int column, long value, java.util.Calendar cal)
          Provides data to be inserted into a DATE, TIME or TIMESTAMP column.
 void putNull(int column, int sqlType)
          puts Null in a column.
 void setThrottling(boolean throttling)
          Sets throttling mode.

 

Method Detail

put

void put(int column,
         java.lang.String value)
provides data to be inserted into a column.

Provides the data to be inserted into the database on the next call to insert. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableInserter. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

Parameters:
column - the column index as described above
value - the value to insert

put

void put(int column,
         double value)
provides data to be inserted into a column.

Provides the data to be inserted into the database on the next call to insert. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableInserter. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

Parameters:
column - the column index as described above
value - the value to insert

put

void put(int column,
         long value)
provides data to be inserted into a column.

Provides the data to be inserted into the database on the next call to insert. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableInserter. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

Parameters:
column - the column index as described above
value - the value to insert

putDate

void putDate(int column,
             long value)
Provides data to be inserted into a DATE, TIME or TIMESTAMP column.

Provides the data to be inserted into the database on the next call to insert. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableInserter. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

The date/time value is inserted in the database in UTC format. Notice that this behavior is different from raw JDBC, which would insert it in a local timezone.

Parameters:
column - the column index as described above
value - the value to insert, measured in milliseconds since midnight, January 1, 1970 UTC.

putDate

void putDate(int column,
             long value,
             java.util.Calendar cal)
Provides data to be inserted into a DATE, TIME or TIMESTAMP column.

Provides the data to be inserted into the database on the next call to insert. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableInserter. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

If the database column stores timezone information, then this information will be taken from the cal parameter. If the database column does not store timezone information, then the value parameter gets converted into the timezone supplied by the cal parameter.

Parameters:
column - the column index as described above
value - the value to insert, measured in milliseconds since midnight, January 1, 1970 UTC.
cal - a Calendar with which to specify timezone

put

void put(int column,
         java.io.InputStream value,
         int length)
provides data to be inserted into a column.

Provides the data to be inserted into the database on the next call to insert. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableInserter. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

Parameters:
column - the column index as described above
value - the value to insert
length - the number of bytes in the stream

put

void put(int column,
         byte[] value)
provides data to be inserted into a column.

Provides the data to be inserted into the database on the next call to insert. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableInserter. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

Parameters:
column - the column index as described above
value - the value to insert

putNull

void putNull(int column,
             int sqlType)
puts Null in a column.

Puts a database Null into the database on the next call to update. The data will be put into the column identified by the column parameter. The parameter is the index into the array of columns that was passed to getTableUpdater. That is, if fred is the 5th element of the array, then passing 5 as the first parameter of this method will set the fred column.

Parameters:
column - the column index as described above
sqlType - the SQL type code of the column as defined in java.sql.Types

insert

void insert()
insert data into a database.

call this method to insert data into a database. The columns to set are specified through the values specified for getTableInserter. If you specified a batch size greater than one, than this method doesn't necessarily insert the data but only batches up the insert.


flush

void flush()
flush the batched insert to the database.

This method will force the batched inserts out to the database.


close

void close()
close the TableInserter object.

It's important to call this method as early as possible in order to free up resources.

This method will automatically force any pending batch operations to the database.


isThrottling

boolean isThrottling()
Returns the throttling mode.
Returns:
true if throttling is enabled, otherwise false.

setThrottling

void setThrottling(boolean throttling)
Sets throttling mode. Throttling cannot be turned off if the updater is synchronous.
Parameters:
throttling - throttling mode.
Throws:
java.lang.IllegalArgumentException - if the method is called on a synchronous updater with false as an argument.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-02


Copyright © 2010, 2011, Oracle. All rights reserved.