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 Row |
getPrimaryKey(Row row,
int[] pkFields) |
static void |
setField(PreparedStatement upload,
int type,
Object field,
int index) |
static void |
setRecordToStatement(PreparedStatement upload,
int[] typesArray,
Row row)
Adds a record to the prepared statement.
|
public static void setRecordToStatement(PreparedStatement upload, int[] typesArray, 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.SQLException
PreparedStatement
public static void setField(PreparedStatement upload, int type, Object field, int index) throws SQLException
SQLException
public static Object getFieldFromResultSet(int index, int type, ResultSet set) throws SQLException
SQLException
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.