Jaxer.DB.MySQL.Connection : Object
Return to: Jaxer Framework index

Creates a new connection to the given databaseName (file).

Platform Support

Jaxer Server Framework Jaxer Client Framework
0.9 no

Constructors

Constructor Action Jaxer Server Framework Jaxer Client Framework
Jaxer.DB.MySQL.Connection Constructor(Object connectionParams) : Jaxer.DB.MySQL.Connection
Creates a new connection to the given databaseName (file). Can be any string value, including an empty string. Creates the specified database if it does not yet exist. The resulting connection object is the only way to interact with the database.
Show Details 0.9 no

Jaxer.DB.MySQL.Connection(Object connectionParams) : Jaxer.DB.MySQL.Connection

Creates a new connection to the given databaseName (file). Can be any string value, including an empty string. Creates the specified database if it does not yet exist. The resulting connection object is the only way to interact with the database.

Parameters
Object connectionParams A hashmap of required parameters to connect to the database. Required properties are HOST (hostname of the server), USER (username for authentication), PASS (password for authentication), NAME (database name), PORT (connection port, default value is "3306"), and CLOSE_AFTER_EXECUTE (whether to close the connection after each call to execute, default is open).

Returns
Jaxer.DB.MySQL.Connection Returns and instance of Connection.

Functions

Method Action Jaxer Server Framework Jaxer Client Framework
close() : void
Closes the connection if it's open. This is optional, and only does something if the connection is open.
No Details 0.9 no
execute(String sql, Array params) : Jaxer.DB.ResultSet
Executes the given sql using the connection. If the second argument is used, it should be an array of parameters to be substituted sequentially for question marks ("?") in the sql statement, which functions as a prepared statement.
Show Details 0.9 no

Parameters
String sql The sql statement to be executed as a prepared statement
Array params The sequential parameters passed to the prepared statement for execution

Returns
Jaxer.DB.ResultSet The results of the query, which may or may not contain any data

open() : void
Opens the connection so queries can be executed. This is optional, since if the connection is not open when it's asked to execute some SQL, it will open the connection automatically. Also closing the connection is optional.
No Details 0.9 no
aptana_docs