public class SybaseUpsert extends Object implements IUpsert
A batch-able upsert strategy that relies on the SQL Merge statement.
Sample Generated SQL:
MERGE INTO tableName target USING (SELECT ?) source(ID) ON target.ID=source.ID
WHEN NOT MATCHED THEN INSERT (col1, col2, col3) VALUES (?, ?, ?)
WHEN MATCHED THEN UPDATE SET col1=?, col2=?, col3=?
| Constructor and Description |
|---|
SybaseUpsert() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch() |
void |
addExceptionProperties(DataException exception) |
SybaseUpsert |
clone() |
void |
close() |
void |
executeBatch() |
void |
executeUpdate() |
String |
getMergeCondition() |
String |
getMergeSql() |
PreparedStatement |
getMergeStatement() |
boolean |
isBatchSupported() |
boolean |
isDebug()
Indicates if the generated SQL should be logged (default false).
|
boolean |
isTerminateWithSemicolon() |
void |
prepare(JdbcUpsertWriter writer,
Record record) |
SybaseUpsert |
setDebug(boolean debug)
Set to
true to log generated SQL (default false). |
SybaseUpsert |
setMergeCondition(String mergeCondition) |
SybaseUpsert |
setTerminateWithSemicolon(boolean terminateWithSemicolon) |
void |
setValues(JdbcUpsertWriter writer,
Record record) |
public String getMergeSql()
public PreparedStatement getMergeStatement()
public String getMergeCondition()
public SybaseUpsert setMergeCondition(String mergeCondition)
public boolean isTerminateWithSemicolon()
public SybaseUpsert setTerminateWithSemicolon(boolean terminateWithSemicolon)
public boolean isDebug()
IUpsertpublic SybaseUpsert setDebug(boolean debug)
IUpserttrue to log generated SQL (default false).public void prepare(JdbcUpsertWriter writer, Record record) throws Throwable
public void setValues(JdbcUpsertWriter writer, Record record) throws Throwable
public void executeUpdate()
throws Throwable
executeUpdate in interface IUpsertThrowablepublic boolean isBatchSupported()
isBatchSupported in interface IUpsertpublic void addBatch()
throws Throwable
public void executeBatch()
throws Throwable
executeBatch in interface IUpsertThrowablepublic SybaseUpsert clone()
public void close()
throws Throwable
public void addExceptionProperties(DataException exception)
addExceptionProperties in interface IUpsertCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.