Class DBStatement
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.DBStatement
-
public class DBStatement extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
BATCH_THRESHOLD_PROPERTY
Name of the batch threshold property.
-
Constructor Summary
Constructors Constructor Description DBStatement(Connection conn, String statementText, int timeout)
This constructor is used for batched updates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 byBATCH_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.
-
-
-
Field Detail
-
BATCH_THRESHOLD_PROPERTY
public static final String BATCH_THRESHOLD_PROPERTY
Name of the batch threshold property.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DBStatement
public DBStatement(Connection conn, String statementText, int timeout) throws SQLException
This constructor is used for batched updates.- Parameters:
conn
- the connectionstatementText
- the statement texttimeout
- the query timeout- Throws:
SQLException
-
-
Method Detail
-
getStatementText
public String getStatementText()
Returns the SQL text.
-
getPreparedStatement
public PreparedStatement getPreparedStatement()
Returns the wrapped PreparedStatement.
-
exceedsBatchThreshold
public boolean exceedsBatchThreshold()
Checks whether the current number of batched commands exceeds the batch threshold defined byBATCH_THRESHOLD
.
-
addBatch
public void addBatch() throws SQLException
Increases the batch counter and delegates the addBatch call to the PreparedStatement wrapped by this DBStatement.- Throws:
SQLException
-
executeBatch
public int[] executeBatch() throws SQLException
Delegates the executeBatch call to the PreparedStatement wrapped by this DBStatement and resets the batch counter.- Throws:
SQLException
-
executeUpdate
public int executeUpdate() throws SQLException
Delegates the executeUpdate call to the PreparedStatement wrapped by this DBStatement.- Throws:
SQLException
-
executeQuery
public ResultSet executeQuery() throws SQLException
Delegates the executeQuery call to the PreparedStatement wrapped by this DBStatement.- Throws:
SQLException
-
close
public void close() throws SQLException
Delegates the close call to the PreparedStatement wrapped by this DBStatement.- Throws:
SQLException
-
bindInputColumn
public void bindInputColumn(int index, Object val, org.netbeans.modules.dbschema.ColumnElement columnElement, DBVendorType vendorType) throws SQLException
Binds the specified value to the column corresponding with the specified index reference.- Parameters:
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 type- Throws:
SQLException
- thrown by setter methods on java.sql.PreparedStatement- See Also:
RetrieveDescImpl.addValueConstraint(java.lang.String, java.lang.Object)
-
-