Public Member Functions | |
ClearWarnings () | |
Clears all warnings reported for this Connection object. | |
Close () | |
Releases a Connection's database and JDBC resources immediately instead of waiting for them to be automatically released. | |
Commit () | |
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the Connection. | |
CommitPrepared (const string transactionid) | |
IZNotification | CreateNotification (const string Event) |
Creates an object to send/recieve notifications from SQL server. | |
IZPreparedStatement | CreatePreparedStatement (const string SQL, TStrings Info) |
Creates a PreparedStatement object for sending parameterized SQL statements to the database. | |
IZStatement | CreateRegularStatement (TStrings Info) |
Creates a Statement object for sending SQL statements to the database. | |
IZSequence | CreateSequence (const string Sequence, Integer BlockSize) |
Creates a sequence generator object. | |
IZStatement | CreateStatement () |
Creates a Statement object for sending SQL statements to the database. | |
IZStatement | CreateStatementWithParams (TStrings Info) |
Creates a Statement object for sending SQL statements to the database. | |
String | EscapeString (String Value) |
Escape a string so it's acceptable for the Connection's server. | |
Boolean | GetAutoCommit () |
Gets the current auto-commit state. | |
string | GetCatalog () |
Gets a selected catalog name. | |
Integer | GetClientVersion () |
Gets client's full version number. | |
PZMySQLConnect | GetConnectionHandle () |
Gets a reference to MySQL connection handle. | |
AnsiString | GetDescription () |
IZDriver | GetDriver () |
Gets the parent ZDBC driver. | |
Integer | GetHostVersion () |
Gets server's full version number. | |
IZDatabaseMetadata | GetMetadata () |
Gets the metadata regarding this connection's database. | |
TStrings | GetParameters () |
Gets a connection parameters. | |
IZMySQLPlainDriver | GetPlainDriver () |
Gets a MySQL plain driver interface. | |
TZTransactIsolationLevel | GetTransactionIsolation () |
Gets this Connection's current transaction isolation level. | |
EZSQLWarning | GetWarnings () |
Returns the first warning reported by calls on this Connection. | |
Boolean | IsClosed () |
Tests to see if a Connection is closed. | |
Boolean | IsReadOnly () |
Tests to see if the connection is in read-only mode. | |
string | NativeSQL (const string SQL) |
Converts the given SQL statement into the system's native SQL grammar. | |
Open () | |
Opens a connection to database server with specified parameters. | |
Integer | PingServer () |
Ping Current Connection's server, if client was disconnected, the connection is resumed. | |
IZCallableStatement | PrepareCall (const string SQL) |
Creates a CallableStatement object for calling database stored procedures. | |
IZCallableStatement | PrepareCallWithParams (const string SQL, TStrings Info) |
Creates a CallableStatement object for calling database stored procedures. | |
IZPreparedStatement | PrepareStatement (const string SQL) |
Creates a PreparedStatement object for sending parameterized SQL statements to the database. | |
IZPreparedStatement | PrepareStatementWithParams (const string SQL, TStrings Info) |
Creates a PreparedStatement object for sending parameterized SQL statements to the database. | |
PrepareTransaction (const string transactionid) | |
Rollback () | |
Drops all changes made since the previous commit/rollback and releases any database locks currently held by this Connection. | |
RollbackPrepared (const string transactionid) | |
SetAutoCommit (Boolean AutoCommit) | |
Sets this connection's auto-commit mode. | |
SetCatalog (const string Catalog) | |
Sets a new selected catalog name. | |
SetReadOnly (Boolean ReadOnly) | |
Puts this connection in read-only mode as a hint to enable database optimizations. | |
SetTransactionIsolation (TZTransactIsolationLevel Level) | |
Sets a new transact isolation level. | |
TZMySQLConnection (IZDriver Driver, const string Url, IZMySQLPlainDriver PlainDriver, const string HostName, Integer Port, const string Database, const string User, const string Password, TStrings Info) | |
Constructs this object and assignes the main properties. | |
~TZMySQLConnection () | |
Destroys this object and cleanups the memory. | |
Protected Member Functions | |
IZCallableStatement | CreateCallableStatement (const string SQL, TStrings Info) |
Creates a callable statement object. | |
RaiseUnsupportedException () | |
Raises unsupported operation exception. | |
Protected Attributes | |
Boolean | AutoCommit |
Boolean | Closed |
string | Database |
IZDriver | Driver |
string | HostName |
TStrings | Info |
string | Password |
Integer | Port |
Boolean | ReadOnly |
TZTransactIsolationLevel | TransactIsolationLevel |
string | User |
Private Attributes | |
string | FCatalog |
string | FClientCodePage |
PZMySQLConnect | FHandle |
IZMySQLPlainDriver | FPlainDriver |
Definition at line 149 of file ZDbcMySql.pas.
TZMySQLConnection::TZMySQLConnection | ( | IZDriver | Driver, | |
const string | Url, | |||
IZMySQLPlainDriver | PlainDriver, | |||
const string | HostName, | |||
Integer | Port, | |||
const string | Database, | |||
const string | User, | |||
const string | Password, | |||
TStrings | Info | |||
) |
Constructs this object and assignes the main properties.
Driver | the parent ZDBC driver. | |
PlainDriver | a MySQL plain driver. | |
HostName | a name of the host. | |
Port | a port number (0 for default port). | |
Database | a name pof the database. | |
User | a user name. | |
Password | a user password. | |
Info | a string list with extra connection parameters. |
Definition at line 513 of file ZDbcMySql.pas.
TZMySQLConnection::~TZMySQLConnection | ( | ) |
TZAbstractConnection::ClearWarnings | ( | ) | [inherited] |
Clears all warnings reported for this Connection
object.
After a call to this method, the method getWarnings
returns null until a new warning is reported for this Connection.
Reimplemented from IZConnection.
Reimplemented in TZAdoConnection, and TZDBLibConnection.
Definition at line 1386 of file ZDbcConnection.pas.
TZMySQLConnection::Close | ( | ) |
Releases a Connection's database and JDBC resources immediately instead of waiting for them to be automatically released.
Note: A Connection is automatically closed when it is garbage collected. Certain fatal errors also result in a closed Connection.
Reimplemented from TZAbstractConnection.
Definition at line 837 of file ZDbcMySql.pas.
TZMySQLConnection::Commit | ( | ) |
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the Connection.
This method should be used only when auto-commit mode has been disabled.
Reimplemented from TZAbstractConnection.
Definition at line 797 of file ZDbcMySql.pas.
TZAbstractConnection::CommitPrepared | ( | const string | transactionid | ) | [inherited] |
Reimplemented from IZConnection.
Reimplemented in TZPostgreSQLConnection.
Definition at line 1111 of file ZDbcConnection.pas.
IZCallableStatement TZAbstractConnection::CreateCallableStatement | ( | const string | SQL, | |
TStrings | Info | |||
) | [protected, inherited] |
Creates a callable statement object.
SQL | a SQL query string. | |
Info | a statement parameters. |
Reimplemented in TZAdoConnection, TZASAConnection, TZDBLibConnection, and TZInterbase6Connection.
Definition at line 992 of file ZDbcConnection.pas.
IZNotification TZAbstractConnection::CreateNotification | ( | const string | Event | ) | [inherited] |
Creates an object to send/recieve notifications from SQL server.
Event | an event name. |
Reimplemented from IZConnection.
Definition at line 1008 of file ZDbcConnection.pas.
IZPreparedStatement TZMySQLConnection::CreatePreparedStatement | ( | const string | SQL, | |
TStrings | Info | |||
) |
Creates a PreparedStatement
object for sending parameterized SQL statements to the database.
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement
will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement
is executed. This has no direct effect on users; however, it does affect which method throws certain SQLExceptions.
Result sets created using the returned PreparedStatement will have forward-only type and read-only concurrency, by default.
sql | a SQL statement that may contain one or more '?' IN parameter placeholders | |
Info | a statement parameters. |
Reimplemented from TZAbstractConnection.
Definition at line 778 of file ZDbcMySql.pas.
IZStatement TZMySQLConnection::CreateRegularStatement | ( | TStrings | Info | ) |
Creates a Statement
object for sending SQL statements to the database.
SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it is more efficient to use a PreparedStatement
object.
Result sets created using the returned Statement
object will by default have forward-only type and read-only concurrency.
Info | a statement parameters. |
Reimplemented from TZAbstractConnection.
Definition at line 740 of file ZDbcMySql.pas.
IZSequence TZAbstractConnection::CreateSequence | ( | const string | Sequence, | |
Integer | BlockSize | |||
) | [inherited] |
Creates a sequence generator object.
Sequence | a name of the sequence generator. | |
BlockSize | a number of unique keys requested in one trip to SQL server. |
Reimplemented from IZConnection.
Reimplemented in TZInterbase6Connection, TZOracleConnection, and TZPostgreSQLConnection.
Definition at line 1024 of file ZDbcConnection.pas.
IZStatement TZAbstractConnection::CreateStatement | ( | ) | [inherited] |
Creates a Statement
object for sending SQL statements to the database.
SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it is more efficient to use a PreparedStatement
object.
Result sets created using the returned Statement
object will by default have forward-only type and read-only concurrency.
Reimplemented from IZConnection.
Definition at line 797 of file ZDbcConnection.pas.
IZStatement TZAbstractConnection::CreateStatementWithParams | ( | TStrings | Info | ) | [inherited] |
Creates a Statement
object for sending SQL statements to the database.
SQL statements without parameters are normally executed using Statement objects. If the same SQL statement is executed many times, it is more efficient to use a PreparedStatement
object.
Result sets created using the returned Statement
object will by default have forward-only type and read-only concurrency.
Info | a statement parameters. |
Reimplemented from IZConnection.
Definition at line 820 of file ZDbcConnection.pas.
String TZMySQLConnection::EscapeString | ( | String | Value | ) |
Escape a string so it's acceptable for the Connection's server.
value | string that should be escaped |
Reimplemented from TZAbstractConnection.
Definition at line 697 of file ZDbcMySql.pas.
Boolean TZAbstractConnection::GetAutoCommit | ( | ) | [inherited] |
Gets the current auto-commit state.
Reimplemented from IZConnection.
Definition at line 1088 of file ZDbcConnection.pas.
string TZMySQLConnection::GetCatalog | ( | ) |
Gets a selected catalog name.
Reimplemented from TZAbstractConnection.
Definition at line 862 of file ZDbcMySql.pas.
Integer TZMySQLConnection::GetClientVersion | ( | ) |
Gets client's full version number.
The format of the version returned must be XYYYZZZ where X = Major version YYY = Minor version ZZZ = Sub version
Reimplemented from TZAbstractConnection.
Definition at line 975 of file ZDbcMySql.pas.
PZMySQLConnect TZMySQLConnection::GetConnectionHandle | ( | ) |
Gets a reference to MySQL connection handle.
Reimplemented from IZMySQLConnection.
Definition at line 1004 of file ZDbcMySql.pas.
AnsiString TZMySQLConnection::GetDescription | ( | ) |
Definition at line 1024 of file ZDbcMySql.pas.
IZDriver TZAbstractConnection::GetDriver | ( | ) | [inherited] |
Gets the parent ZDBC driver.
Reimplemented from IZConnection.
Definition at line 1206 of file ZDbcConnection.pas.
Integer TZMySQLConnection::GetHostVersion | ( | ) |
Gets server's full version number.
The format of the returned version must be XYYYZZZ where X = Major version YYY = Minor version ZZZ = Sub version
Reimplemented from TZAbstractConnection.
Definition at line 991 of file ZDbcMySql.pas.
IZDatabaseMetadata TZAbstractConnection::GetMetadata | ( | ) | [inherited] |
Gets the metadata regarding this connection's database.
A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, and so on. This information is made available through a DatabaseMetaData object.
Reimplemented from IZConnection.
Definition at line 1224 of file ZDbcConnection.pas.
TStrings TZAbstractConnection::GetParameters | ( | ) | [inherited] |
Gets a connection parameters.
Reimplemented from IZConnection.
Definition at line 1236 of file ZDbcConnection.pas.
IZMySQLPlainDriver TZMySQLConnection::GetPlainDriver | ( | ) |
Gets a MySQL plain driver interface.
Reimplemented from IZMySQLConnection.
Definition at line 1016 of file ZDbcMySql.pas.
TZTransactIsolationLevel TZAbstractConnection::GetTransactionIsolation | ( | ) | [inherited] |
Gets this Connection's current transaction isolation level.
Reimplemented from IZConnection.
Definition at line 1359 of file ZDbcConnection.pas.
EZSQLWarning TZAbstractConnection::GetWarnings | ( | ) | [inherited] |
Returns the first warning reported by calls on this Connection.
Note: Subsequent warnings will be chained to this SQLWarning.
Reimplemented from IZConnection.
Reimplemented in TZAdoConnection, and TZDBLibConnection.
Definition at line 1373 of file ZDbcConnection.pas.
Boolean TZAbstractConnection::IsClosed | ( | ) | [inherited] |
Tests to see if a Connection is closed.
Reimplemented from IZConnection.
Definition at line 1194 of file ZDbcConnection.pas.
Boolean TZAbstractConnection::IsReadOnly | ( | ) | [inherited] |
Tests to see if the connection is in read-only mode.
Reimplemented from IZConnection.
Definition at line 1300 of file ZDbcConnection.pas.
string TZAbstractConnection::NativeSQL | ( | const string | SQL | ) | [inherited] |
Converts the given SQL statement into the system's native SQL grammar.
A driver may convert the JDBC sql grammar into its system's native SQL grammar prior to sending it; this method returns the native form of the statement that the driver would have sent.
sql | a SQL statement that may contain one or more '?' parameter placeholders |
Reimplemented from IZConnection.
Reimplemented in TZAdoConnection, and TZDBLibConnection.
Definition at line 1045 of file ZDbcConnection.pas.
TZMySQLConnection::Open | ( | ) |
Opens a connection to database server with specified parameters.
Reimplemented from TZAbstractConnection.
Definition at line 556 of file ZDbcMySql.pas.
Integer TZMySQLConnection::PingServer | ( | ) |
Ping Current Connection's server, if client was disconnected, the connection is resumed.
Reimplemented from TZAbstractConnection.
Definition at line 673 of file ZDbcMySql.pas.
IZCallableStatement TZAbstractConnection::PrepareCall | ( | const string | SQL | ) | [inherited] |
Creates a CallableStatement
object for calling database stored procedures.
The CallableStatement
object provides methods for setting up its IN and OUT parameters, and methods for executing the call to a stored procedure.
Note: This method is optimized for handling stored procedure call statements. Some drivers may send the call statement to the database when the method prepareCall
is done; others may wait until the CallableStatement
object is executed. This has no direct effect on users; however, it does affect which method throws certain SQLExceptions.
Result sets created using the returned CallableStatement will have forward-only type and read-only concurrency, by default.
sql | a SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is a JDBC function call escape string. |
Reimplemented from IZConnection.
Definition at line 953 of file ZDbcConnection.pas.
IZCallableStatement TZAbstractConnection::PrepareCallWithParams | ( | const string | SQL, | |
TStrings | Info | |||
) | [inherited] |
Creates a CallableStatement
object for calling database stored procedures.
The CallableStatement
object provides methods for setting up its IN and OUT parameters, and methods for executing the call to a stored procedure.
SQL | a SQL statement that may contain one or more '?' parameter placeholders. Typically this statement is a JDBC function call escape string. | |
Info | a statement parameters. |
Reimplemented from IZConnection.
Definition at line 976 of file ZDbcConnection.pas.
IZPreparedStatement TZAbstractConnection::PrepareStatement | ( | const string | SQL | ) | [inherited] |
Creates a PreparedStatement
object for sending parameterized SQL statements to the database.
A SQL statement with or without IN parameters can be pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method prepareStatement
will send the statement to the database for precompilation. Some drivers may not support precompilation. In this case, the statement may not be sent to the database until the PreparedStatement
is executed. This has no direct effect on users; however, it does affect which method throws certain SQLExceptions.
Result sets created using the returned PreparedStatement will have forward-only type and read-only concurrency, by default.
sql | a SQL statement that may contain one or more '?' IN parameter placeholders |
Reimplemented from IZConnection.
Definition at line 872 of file ZDbcConnection.pas.
IZPreparedStatement TZAbstractConnection::PrepareStatementWithParams | ( | const string | SQL, | |
TStrings | Info | |||
) | [inherited] |
Creates a PreparedStatement
object for sending parameterized SQL statements to the database.
SQL | a SQL statement that may contain one or more '?' IN parameter placeholders | |
Info | a statement parameters. |
Reimplemented from IZConnection.
Definition at line 891 of file ZDbcConnection.pas.
TZAbstractConnection::PrepareTransaction | ( | const string | transactionid | ) | [inherited] |
Reimplemented from IZConnection.
Reimplemented in TZPostgreSQLConnection.
Definition at line 901 of file ZDbcConnection.pas.
References P.
TZAbstractConnection::RaiseUnsupportedException | ( | ) | [protected, inherited] |
TZMySQLConnection::Rollback | ( | ) |
Drops all changes made since the previous commit/rollback and releases any database locks currently held by this Connection.
This method should be used only when auto- commit has been disabled.
Reimplemented from TZAbstractConnection.
Definition at line 816 of file ZDbcMySql.pas.
TZAbstractConnection::RollbackPrepared | ( | const string | transactionid | ) | [inherited] |
Reimplemented from IZConnection.
Reimplemented in TZPostgreSQLConnection.
Definition at line 1135 of file ZDbcConnection.pas.
TZMySQLConnection::SetAutoCommit | ( | Boolean | AutoCommit | ) |
Sets this connection's auto-commit mode.
If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit
or the method rollback
. By default, new connections are in auto-commit mode.
The commit occurs when the statement completes or the next execute occurs, whichever comes first. In the case of statements returning a ResultSet, the statement completes when the last row of the ResultSet has been retrieved or the ResultSet has been closed. In advanced cases, a single statement may return multiple results as well as output parameter values. In these cases the commit occurs when all results and output parameter values have been retrieved.
autoCommit | true enables auto-commit; false disables auto-commit. |
Reimplemented from TZAbstractConnection.
Definition at line 952 of file ZDbcMySql.pas.
TZMySQLConnection::SetCatalog | ( | const string | Catalog | ) |
Sets a new selected catalog name.
Catalog | a selected catalog name. |
Reimplemented from TZAbstractConnection.
Definition at line 874 of file ZDbcMySql.pas.
TZAbstractConnection::SetReadOnly | ( | Boolean | ReadOnly | ) | [inherited] |
Puts this connection in read-only mode as a hint to enable database optimizations.
Note: This method cannot be called while in the middle of a transaction.
readOnly | true enables read-only mode; false disables read-only mode. |
Reimplemented from IZConnection.
Reimplemented in TZAdoConnection, and TZDBLibConnection.
Definition at line 1287 of file ZDbcConnection.pas.
TZMySQLConnection::SetTransactionIsolation | ( | TZTransactIsolationLevel | Level | ) |
Sets a new transact isolation level.
Level | a new transact isolation level. |
Reimplemented from TZAbstractConnection.
Definition at line 887 of file ZDbcMySql.pas.
Boolean TZAbstractConnection::AutoCommit [protected, inherited] |
FAutoCommit For writing
Definition at line 221 of file ZDbcConnection.pas.
Boolean TZAbstractConnection::Closed [protected, inherited] |
string TZAbstractConnection::Database [protected, inherited] |
Definition at line 209 of file ZDbcConnection.pas.
IZDriver TZAbstractConnection::Driver [protected, inherited] |
string TZMySQLConnection::FCatalog [private] |
Definition at line 154 of file ZDbcMySql.pas.
string TZMySQLConnection::FClientCodePage [private] |
Definition at line 160 of file ZDbcMySql.pas.
PZMySQLConnect TZMySQLConnection::FHandle [private] |
Definition at line 158 of file ZDbcMySql.pas.
Definition at line 156 of file ZDbcMySql.pas.
string TZAbstractConnection::HostName [protected, inherited] |
Definition at line 203 of file ZDbcConnection.pas.
TStrings TZAbstractConnection::Info [protected, inherited] |
string TZAbstractConnection::Password [protected, inherited] |
Definition at line 215 of file ZDbcConnection.pas.
Integer TZAbstractConnection::Port [protected, inherited] |
Boolean TZAbstractConnection::ReadOnly [protected, inherited] |
Definition at line 224 of file ZDbcConnection.pas.
TZTransactIsolationLevel TZAbstractConnection::TransactIsolationLevel [protected, inherited] |
FTransactIsolationLevel For writing
Definition at line 228 of file ZDbcConnection.pas.
string TZAbstractConnection::User [protected, inherited] |