Class DmlStatement
java.lang.Object
com.mcpdbwizard.pub.StatementParameters2
com.mcpdbwizard.pub.DmlStatement
- All Implemented Interfaces:
OracleResourceUser
- Direct Known Subclasses:
QueryStatement
A parameterized SQL statement
that continues to exist even if the connection it uses is withdrawn.
Under normal circumstances MCPDBWizard users will have no reason to use this class directly - the generated code will use it.
Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)
- Version:
- 7
- Author:
- [email protected]
-
Field Summary
Fields inherited from class com.mcpdbwizard.pub.StatementParameters2
inputParameterFilesizeArray, inputParameterSetArray, parameterArray, parameterOpaqueTypeNameArray, parameterTypeArray -
Constructor Summary
ConstructorsConstructorDescriptionDmlStatement(String statementSqlText, LogInterface theLog) Create a DML Statement object.DmlStatement(String statementSqlText, LogInterface theLog, Connection theConnection) Create a DML Statement object and give it a connection -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if our connection is usableprotected booleanPrepare the statement if needed.voidRelease the current connectionReturn underlying java.sql.Statement Object.booleanUsed to tell if the object is using Oracle resources.booleanUsed to tell an object to release its Oracle resources.voidsetConnection(Connection theConnection) Provide a connectionprotected voidComplain if the connection does not exist.Methods inherited from class com.mcpdbwizard.pub.StatementParameters2
bindParameters, checkBuild, checkRange, checkSet, clearParameters, getParam, getParamCount, getParameters, getSignature, setNativeBooleanParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setParam, setPlSqlIndexArrayParam, setPlSqlTableArrayParam, setVectorBinaryParam, setVectorSparseParam
-
Constructor Details
-
DmlStatement
Create a DML Statement object and give it a connection -
DmlStatement
Create a DML Statement object.
-
-
Method Details
-
setConnection
Provide a connection- Parameters:
theConnection-
-
testConnection
Complain if the connection does not exist.- Throws:
CSDBException- No database connection was available when this method was called
-
createPreparedStatement
Prepare the statement if needed.- Returns:
trueif we had to prepare the statementfalseif the statement was already prepared- Throws:
CSDBException- We were unable to prepare the statement
-
freeConnection
public void freeConnection()Release the current connectionThe prepared Statement will be closed and nullified.
-
connectionIsUsable
public boolean connectionIsUsable()Check if our connection is usable- Returns:
trueif our connecion is usablefalseif our connecion is not usable
-
hasResources
public boolean hasResources()Used to tell if the object is using Oracle resources.- Specified by:
hasResourcesin interfaceOracleResourceUser- Returns:
trueif the object holds a resource.falseif the object does not hold a resource.
-
releaseResources
public boolean releaseResources()Used to tell an object to release its Oracle resources. This method never throws an exception. If releasing the resource will create problems they should be dealt with by the implementing class, not escalated to the calling class.- Specified by:
releaseResourcesin interfaceOracleResourceUser- Returns:
trueif the objects held an open PreparedStatement, ResultSet or similer resource.
-
getUnderlyingStatement
Return underlying java.sql.Statement Object. This method exists so that users can call the various methods such as 'setQueryTimeout' that are defined in the java.sql.Statement interface. Do not use it to replace the Statement object.- Returns:
- java.sql.Statement
- Throws:
CSDBException- If we had to try to create the Statement before we could return it and something went wrong.- Since:
- 5.0.2267 Retuens Statement Object.
-