public class JDBCUtils extends Object
| 构造器和说明 |
|---|
JDBCUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
getFieldFromResultSet(int index,
int type,
ResultSet set) |
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
SQLExceptionCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.