Libraries anvil sql Connection

class Connection
extends anvil.lang.object
Database connection.

Methods

Statement call(string querystring)
Creates a Statement object for calling database stored procedures. The Statement provides methods for setting up its IN and OUT parameters, and methods for executing the call to a stored procedure.
Returns Statement object
Throws SQLError -  if an error occured

Connection close()
Closes this connection. Only effective if this connection was not retrieved from the connection pool.
Throws SQLError -  if an error occured

Connection commit()
Commits statements.
Throws SQLError -  if an error occured

boolean getAutoCommit()
Checks if connection is auto committing after each statement.
Returns true if is auto committing
Throws SQLError -  if an error occured

string getCatalog()
Returns the catalog used
Throws SQLError -  if an error occured

boolean isReadOnly()
Checks if connection is marked read-only.
Returns true if read-only
Throws SQLError -  if an error occured

Statement prepare(string querystring)
Creates a Statement 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.
Returns Statement object
Throws SQLError -  if an error occured

object query(string querystring, [ object parameters, ... ] )
Executes given 'querystring' in this connection.
Parameters querystring -  see anvil.sql#query for details
Returns see anvil.sql#query for details
Throws SQLError -  if an error occured

Connection release()
Releases connection back to pool.

Connection rollback()
Rollbacks statements.
Throws SQLError -  if an error occured

void setAutoCommit(boolean autoCommit)
Sets the auto commit status of connection to 'autoCommit'.
Parameters autoCommit - 
Throws SQLError -  if an error occured

Connection setCatalog(string catalog)
Sets the catalog to 'catalog'.
Parameters catalog - 
Throws SQLError -  if an error occured

Connection setReadOnly(boolean readOnly)
Sets the read only status of connection to 'readOnly' (database may perform certain optimizations according to this information).
Parameters readOnly - 
Throws SQLError -  if an error occured