Package adams.db
Class MultipleInsert
- java.lang.Object
-
- adams.db.MultipleInsert
-
- All Implemented Interfaces:
Serializable
public class MultipleInsert extends Object implements Serializable
Manages a multiple insert operation for a table (bulkinserttable)- Author:
- dale
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intcountinserts.protected List<String>m_colscolumns for insert.protected BulkInsertTablem_insertTable this is associated with.protected intm_insert_atforce insert to db at count.protected StringBuilderm_sbbuilds insert string.
-
Constructor Summary
Constructors Constructor Description MultipleInsert(int max)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetInsertString()Return an sql string for insert of current dataStringinsert(Hashtable<String,String> vals)Insert.booleaninsertComplete()Finalise insert.voidsetColumnVector(List<String> sv)Set the columns used for insertvoidsetTable(BulkInsertTable bti)Set the table associated with this insert manager
-
-
-
Field Detail
-
m_sb
protected StringBuilder m_sb
builds insert string.
-
count
protected int count
inserts.
-
m_insert_at
protected int m_insert_at
force insert to db at count.
-
m_insert
protected BulkInsertTable m_insert
Table this is associated with.
-
-
Method Detail
-
setTable
public void setTable(BulkInsertTable bti)
Set the table associated with this insert manager- Parameters:
bti- table
-
setColumnVector
public void setColumnVector(List<String> sv)
Set the columns used for insert- Parameters:
sv- column vector
-
insert
public String insert(Hashtable<String,String> vals)
Insert. Get values from hashtable- Parameters:
vals- Hashtable of ColumnName(string)->InsertValue(string)- Returns:
- Insert string, if time to insert. Else null;
-
insertComplete
public boolean insertComplete()
Finalise insert. Insert any remaining rows to db- Returns:
- success?
-
getInsertString
public String getInsertString()
Return an sql string for insert of current data- Returns:
- insert string
-
-