Package | com.ericfeminella.sql |
Class | public class PreparedStatement |
Inheritance | PreparedStatement ![]() |
PreparedStatement
provides a SQLStatement
implementation which enforces the text
property of a
statement to be sealed, that is it can only be assigned during
creation of the statement.
Before a SQLStatement
is executed, the runtime prepares
(compiles) the statement in order to determine the steps which are
to be performed internally to carry out the statement.
When a call to SQLStatement.execute
is made on a SQLStatement
instance which has not previously been executed, the statement is automatically
prepared before it is executed. On subsequent calls to the execute method,
as long as the SQLStatement.text
property has not changed the
statement is still prepared thus allowing the statement to execute faster.
By enforcing the SQLStatement.text
property is only assigned
a value once, a PreparedStatement
statement can be utilized to
improve performance of the statements execution.
See also
Property | Defined by | ||
---|---|---|---|
text : String [write-only]
By overriding the implicit setter of the
text property
a PreparedStatement ensures that the property is only
assigned a value during object construction. | PreparedStatement |
Method | Defined by | ||
---|---|---|---|
PreparedStatement(statementText:String, connection:SQLConnection = null, itemClass:Class = null)
The
PreparedStatement constructor requires the statement
text which is assigned to the text
| PreparedStatement |
text | property |
text:String
[write-only]
By overriding the implicit setter of the text
property
a PreparedStatement
ensures that the property is only
assigned a value during object construction.
public function set text(value:String):void
— |
See also
PreparedStatement | () | constructor |
public function PreparedStatement(statementText:String, connection:SQLConnection = null, itemClass:Class = null)
The PreparedStatement
constructor requires the statement
text which is assigned to the text
statementText:String — statement which is to be executed by this PreparedStatement
|
|
connection:SQLConnection (default = null ) — which the statement is to execute against
|
|
itemClass:Class (default = null ) — which the results of the statement are to be resolved
|
const select:String = "SELECT FROM foo.bar"; var statement:PreparedStatement = new PreparedStatement( select );