public class DBStatement extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BATCH_THRESHOLD_PROPERTY
Name of the batch threshold property.
|
| Constructor and Description |
|---|
DBStatement(Connection conn,
String statementText,
int timeout)
This constructor is used for batched updates.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch()
Increases the batch counter and delegates the addBatch call to the
PreparedStatement wrapped by this DBStatement.
|
void |
bindInputColumn(int index,
Object val,
org.netbeans.modules.dbschema.ColumnElement columnElement,
DBVendorType vendorType)
Binds the specified value to the column corresponding with
the specified index reference.
|
void |
close()
Delegates the close call to the PreparedStatement wrapped by
this DBStatement.
|
boolean |
exceedsBatchThreshold()
Checks whether the current number of batched commands exceeds the
batch threshold defined by
BATCH_THRESHOLD. |
int[] |
executeBatch()
Delegates the executeBatch call to the PreparedStatement wrapped by
this DBStatement and resets the batch counter.
|
ResultSet |
executeQuery()
Delegates the executeQuery call to the PreparedStatement wrapped by
this DBStatement.
|
int |
executeUpdate()
Delegates the executeUpdate call to the PreparedStatement wrapped by
this DBStatement.
|
PreparedStatement |
getPreparedStatement()
Returns the wrapped PreparedStatement.
|
String |
getStatementText()
Returns the SQL text.
|
public static final String BATCH_THRESHOLD_PROPERTY
public DBStatement(Connection conn, String statementText, int timeout) throws SQLException
conn - the connectionstatementText - the statement texttimeout - the query timeoutSQLExceptionpublic String getStatementText()
public PreparedStatement getPreparedStatement()
public boolean exceedsBatchThreshold()
BATCH_THRESHOLD.public void addBatch()
throws SQLException
SQLExceptionpublic int[] executeBatch()
throws SQLException
SQLExceptionpublic int executeUpdate()
throws SQLException
SQLExceptionpublic ResultSet executeQuery() throws SQLException
SQLExceptionpublic void close()
throws SQLException
SQLExceptionpublic void bindInputColumn(int index,
Object val,
org.netbeans.modules.dbschema.ColumnElement columnElement,
DBVendorType vendorType)
throws SQLException
index - the indexval - the valuecolumnElement - the columnElement corresponding to the parameter
marker at specified index. This parameter will always contain correct
value when called for sql statements corresponding to insert and update
For select statements this parameter can be null if query compiler is not
able to detect java field for a parameter or value passed to the query.
Please see RetrieveDescImpl#addValueConstraint for more informationvendorType - the vendor typeSQLException - thrown by setter methods on java.sql.PreparedStatementRetrieveDescImpl.addValueConstraint(java.lang.String, java.lang.Object)Copyright © 2019. All rights reserved.