Class SQLRConnection
In: sqlrelay.cpp
Parent: Object

Methods

Public Class methods

Initiates a connection to "host" on "port" or to the unix "socket" on the local machine and authenticates with "user" and "password". Failed connections will be retried for "tries" times on interval "retrytime". If "tries" is 0 then retries will continue forever. If "retrytime" is 0 then retries will be attempted on a default interval. If the "socket" parameter is nether nil nor "" then an attempt will be made to connect through it before attempting to connect to "host" on "port". If it is nil or "" then no attempt will be made to connect through the socket.

Public Instance methods

Instructs the database to wait for the client to tell it when to commit.

Instructs the database to perform a commit after every successful query.

Begins a transaction. Returns true if the begin succeeded, false if it failed. If the database automatically begins a new transaction when a commit or rollback is issued then this doesn‘t do anything unless SQL Relay is faking transaction blocks.

Returns a string representing the format of the bind variables used in the db.

Returns the version of the sqlrelay client software.

Issues a commit. Returns true if the commit succeeded, false if it failed.

Returns the host name of the database

Returns the ip address of the database

Returns the version of the database

Turns debugging off.

Causes verbose debugging information to be sent to standard output. Another way to do this is to start a query with "— debug\n". Yet another way is to set the environment variable SQLR_CLIENT_DEBUG to "ON"

Ends the session.

If an operation failed and generated an error, the error message is available here. If there is no error then this method returns nil

If an operation failed and generated an error, the error number is available here. If there is no error then this method returns 0.

Returns the string that was set by setClientInfo().

Returns the inet port that the connection is communicating over. This parameter may be passed to another connection for use in the sqlrcon_resumeSession() command. Note: The result this function returns is only valid after a call to suspendSession().

Returns the unix socket that the connection is communicating over. This parameter may be passed to another connection for use in the sqlrcon_resumeSession() command. Note: The result this function returns is only valid after a call to suspendSession().

Returns the database/schema that is currently in use.

Returns 0 if debugging is off and 1 if debugging is on.

Returns the value of the autoincrement column for the last insert

Returns the type of database: oracle, postgresql, mysql, etc.

Returns 1 if the database is up and 0 if it‘s down.

Resumes a session previously left open using sqlrcon_suspendSession(). Returns 1 on success and 0 on failure.

Issues a rollback. Returns true if the rollback succeeded, false if it failed.

Sets the current database/schema to "database"

Returns the version of the sqlrelay server software.

Allows you to set a string that will be passed to the server and ultimately included in server-side logging along with queries that were run by this instance of the client.

Sets the server connect timeout in seconds and milliseconds. Setting either parameter to -1 disables the timeout. You can also set this timeout using the SQLR_CLIENT_CONNECT_TIMEOUT environment variable.

Disconnects this connection from the current session but leaves the session open so that another connection can connect to it using sqlrcon_resumeSession().

[Validate]