Package org.apache.pulsar.io.jdbc
Class JdbcUtils
java.lang.Object
org.apache.pulsar.io.jdbc.JdbcUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic PreparedStatementbuildDeleteStatement(Connection connection, String deleteSQL) static Stringstatic PreparedStatementbuildInsertStatement(Connection connection, String insertSQL) static Stringstatic StringJoinerstatic PreparedStatementbuildUpdateStatement(Connection connection, String updateSQL) static StringcombationWhere(List<JdbcUtils.ColumnId> columnIds) static JdbcUtils.TableDefinitiongetTableDefinition(Connection connection, JdbcUtils.TableId tableId, List<String> keyList, List<String> nonKeyList) Get theJdbcUtils.TableDefinitionfor the given table.static JdbcUtils.TableIdgetTableId(Connection connection, String tableName) Get theJdbcUtils.TableIdfor the given tableName.
-
Constructor Details
-
JdbcUtils
public JdbcUtils()
-
-
Method Details
-
getTableId
public static JdbcUtils.TableId getTableId(Connection connection, String tableName) throws Exception Get theJdbcUtils.TableIdfor the given tableName.- Throws:
Exception
-
getTableDefinition
public static JdbcUtils.TableDefinition getTableDefinition(Connection connection, JdbcUtils.TableId tableId, List<String> keyList, List<String> nonKeyList) throws Exception Get theJdbcUtils.TableDefinitionfor the given table.- Throws:
Exception
-
buildInsertSql
-
buildInsertStatement
public static PreparedStatement buildInsertStatement(Connection connection, String insertSQL) throws SQLException - Throws:
SQLException
-
combationWhere
-
buildUpdateSql
-
buildUpdateSqlSetPart
-
buildUpdateStatement
public static PreparedStatement buildUpdateStatement(Connection connection, String updateSQL) throws SQLException - Throws:
SQLException
-
buildDeleteSql
-
buildDeleteStatement
public static PreparedStatement buildDeleteStatement(Connection connection, String deleteSQL) throws SQLException - Throws:
SQLException
-