public class SimpleTableCopier extends java.lang.Object implements TableCopier
| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
SimpleTableCopier.CopyParams |
| 构造器和说明 |
|---|
SimpleTableCopier() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected java.lang.String |
buildInsertSql(Table sourceTable,
Table targetTable) |
protected java.lang.String |
buildQuerySql(Table table) |
int |
copy(TableInput source,
TableInput target,
int batchSize,
SqlBiConsumer<java.sql.ResultSet,java.sql.PreparedStatement> recordCopier)
从源表复制数据到目标表。
|
protected int |
copyAllRecords(SimpleTableCopier.CopyParams params,
java.sql.ResultSet rs,
java.sql.PreparedStatement ps) |
protected void |
copyRecord(SimpleTableCopier.CopyParams params,
java.sql.ResultSet rs,
java.sql.PreparedStatement ps) |
protected java.sql.PreparedStatement |
createInsertStatement(java.sql.Connection conn,
java.lang.String sql) |
protected java.sql.PreparedStatement |
createQueryStatement(java.sql.Connection conn,
java.lang.String sql) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopypublic int copy(TableInput source, TableInput target, int batchSize, SqlBiConsumer<java.sql.ResultSet,java.sql.PreparedStatement> recordCopier) throws java.sql.SQLException
TableCopiercopy 在接口中 TableCopiersource - 源target - 目标batchSize - 批次大小recordCopier - 自定的记录复制处理器,主要作用是将一条记录从 ResultSet 复制到 PreparedStatement 对象java.sql.SQLException - 复制过程可能出现的SQL异常,复制程序不捕捉任何 SQL 异常protected java.lang.String buildQuerySql(Table table)
protected java.sql.PreparedStatement createQueryStatement(java.sql.Connection conn,
java.lang.String sql)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.sql.PreparedStatement createInsertStatement(java.sql.Connection conn,
java.lang.String sql)
throws java.sql.SQLException
java.sql.SQLExceptionprotected int copyAllRecords(SimpleTableCopier.CopyParams params, java.sql.ResultSet rs, java.sql.PreparedStatement ps) throws java.sql.SQLException
java.sql.SQLExceptionprotected void copyRecord(SimpleTableCopier.CopyParams params, java.sql.ResultSet rs, java.sql.PreparedStatement ps) throws java.sql.SQLException
java.sql.SQLExceptionCopyright © 2025. All rights reserved.