public class MultiRowStatementInsert extends DataObject implements IInsert
Sample Generated SQL:
INSERT INTO tableName (col1, col2, col3) VALUES
(val1, val2, val3),
(val1, val2, val3),
(val1, val2, val3),..
Modifier and Type | Field and Description |
---|---|
protected SimpleDateFormat |
DATE_FORMAT |
protected SimpleDateFormat |
DATE_TIME_FORMAT |
protected SimpleDateFormat |
TIME_FORMAT |
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
MultiRowStatementInsert() |
protected final SimpleDateFormat DATE_TIME_FORMAT
protected final SimpleDateFormat DATE_FORMAT
protected final SimpleDateFormat TIME_FORMAT
public boolean isDebug()
IInsert
public MultiRowStatementInsert setDebug(boolean debug)
IInsert
true
to log generated SQL (default false).public void prepare(JdbcWriter writer, Record record) throws Throwable
public void setValues(JdbcWriter writer, Record record) throws Throwable
protected String getIntLiteral(int value)
protected String getLongLiteral(long value)
protected String getDoubleLiteral(double value)
protected String getBigIntegerLiteral(BigInteger value)
protected String getBigDecimalLiteral(BigDecimal value)
protected String getBooleanLiteral(boolean value)
protected String getByteLiteral(byte value)
protected String getFloatLiteral(float value)
protected String getShortLiteral(short value)
protected String getBytesLiteral(byte[] value)
public void executeUpdate() throws Throwable
executeUpdate
in interface IInsert
Throwable
protected String getInsertSqlPrefix()
protected MultiRowStatementInsert setInsertSqlPrefix(String insertSqlPrefix)
protected StringBuilder getInsertSql()
protected Statement getInsertStatement()
protected MultiRowStatementInsert setInsertStatement(Statement insertStatement)
protected int getRecordsPendingInsert()
protected MultiRowStatementInsert setRecordsPendingInsert(int recordsPendingInsert)
public boolean isBatchSupported()
isBatchSupported
in interface IInsert
public void addBatch() throws Throwable
public void executeBatch() throws Throwable
executeBatch
in interface IInsert
Throwable
public void close() throws Throwable
public MultiRowStatementInsert clone()
public DataException addExceptionProperties(DataException exception)
DataObject
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in interface IInsert
addExceptionProperties
in class DataObject
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.