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 int
count
inserts.protected List<String>
m_cols
columns for insert.protected BulkInsertTable
m_insert
Table this is associated with.protected int
m_insert_at
force insert to db at count.protected StringBuilder
m_sb
builds insert string.
-
Constructor Summary
Constructors Constructor Description MultipleInsert(int max)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getInsertString()
Return an sql string for insert of current dataString
insert(Hashtable<String,String> vals)
Insert.boolean
insertComplete()
Finalise insert.void
setColumnVector(List<String> sv)
Set the columns used for insertvoid
setTable(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
-
-