public class JdbcUtils extends Object
| Constructor and Description |
|---|
JdbcUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
getFieldFromResultSet(int index,
int type,
ResultSet set) |
static org.apache.flink.types.Row |
getPrimaryKey(org.apache.flink.types.Row row,
int[] pkFields) |
static void |
setField(PreparedStatement upload,
int type,
Object field,
int index) |
static void |
setRecordToStatement(PreparedStatement upload,
int[] typesArray,
org.apache.flink.types.Row row)
Adds a record to the prepared statement.
|
public static void setRecordToStatement(PreparedStatement upload, int[] typesArray, org.apache.flink.types.Row row) throws SQLException
When this method is called, the output format is guaranteed to be opened.
WARNING: this may fail when no column types specified (because a best effort approach is attempted in order to insert a null value but it's not guaranteed that the JDBC driver handles PreparedStatement.setObject(pos, null))
upload - The prepared statement.typesArray - The jdbc types of the row.row - The records to add to the output.SQLExceptionPreparedStatementpublic static void setField(PreparedStatement upload, int type, Object field, int index) throws SQLException
SQLExceptionpublic static Object getFieldFromResultSet(int index, int type, ResultSet set) throws SQLException
SQLExceptionpublic static org.apache.flink.types.Row getPrimaryKey(org.apache.flink.types.Row row,
int[] pkFields)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.