Package adams.db
Class BulkInsertTable
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.db.generic.SQL
-
- adams.db.AbstractTable
-
- adams.db.AbstractIndexedTable
-
- adams.db.BulkInsertTable
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,SQLIntf
,TableInterface
,DatabaseConnectionChangeListener
,Serializable
public abstract class BulkInsertTable extends AbstractIndexedTable
Table that can do bulk inserts.- Author:
- dale
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>
m_cols
columns for bulk insert.-
Fields inherited from class adams.db.AbstractIndexedTable
m_init
-
Fields inherited from class adams.db.AbstractTable
FILENAME, m_AnsiQuotes, m_Properties, m_TableName
-
Fields inherited from class adams.db.generic.SQL
m_DatabaseConnection, m_Debug, m_TableManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.db.SQLIntf
FAKE_TABLE_NAME
-
-
Constructor Summary
Constructors Constructor Description BulkInsertTable(AbstractDatabaseConnection dbcon, String tablename)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
attach(MultipleInsert mi)
Attach a multiple insert object to this table.protected boolean
doInsert(MultipleInsert mi)
Performs the bulk insert.String
generateInsertHeader()
Return Insert header.protected String
getInsertColumnsAsString()
Return columns as comma separated list.boolean
insert(MultipleInsert mi, Hashtable<String,String> vals)
Insert bulk data.boolean
insertComplete(MultipleInsert mi)
Complete bulk insert.-
Methods inherited from class adams.db.AbstractIndexedTable
columnsMatch, columnsMatchTest, create, getAllColumns, getColumnMapping, getIndices, getTables, init, initTables, isThere, postCreate, select, select, selectDistinct, selectDistinct, truncate, update
-
Methods inherited from class adams.db.AbstractTable
columnExists, databaseConnectionStateChanged, getProperties, getTableName, isEnabled, quoteName, tableExists, toString, useAnsiQuotes
-
Methods inherited from class adams.db.generic.SQL
columnExists, doSelect, drop, execute, executeGeneratedKeys, getDatabaseConnection, getDebug, getMaxColumnNameLength, getResultSet, getSimpleResultSet, prepareStatement, prepareStatement, prepareStatement, select, selectDistinct, selectDouble, selectInt, selectLong, selectString, selectStrings, setDebug, singleton, tableExists, truncate, update, updatePrefix, updateTableName
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
-
-
-
Constructor Detail
-
BulkInsertTable
public BulkInsertTable(AbstractDatabaseConnection dbcon, String tablename)
Constructor. Setup column vector.- Parameters:
dbcon
- the database context this table is used intablename
- the name of the table
-
-
Method Detail
-
generateInsertHeader
public String generateInsertHeader()
Return Insert header. Generated from column names- Returns:
- insert header
-
attach
public void attach(MultipleInsert mi)
Attach a multiple insert object to this table.- Parameters:
mi
- the insert
-
insert
public boolean insert(MultipleInsert mi, Hashtable<String,String> vals)
Insert bulk data.- Parameters:
mi
- multiple insertvals
- hashtable of values- Returns:
- success?
-
doInsert
protected boolean doInsert(MultipleInsert mi)
Performs the bulk insert.- Parameters:
mi
- the insert- Returns:
- success?
-
insertComplete
public boolean insertComplete(MultipleInsert mi)
Complete bulk insert.- Parameters:
mi
- the insert- Returns:
- success?
-
getInsertColumnsAsString
protected String getInsertColumnsAsString()
Return columns as comma separated list.- Returns:
- column names
-
-