Creates a new connection to the given databaseName (file).
Platform Support
Jaxer Server Framework | Jaxer Client Framework | 1.0 | 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. The resulting connection object is the only way to interact with the database.
|
Show Details | 1.0 | no | |||||
Jaxer.DB.MySQL.Connection(Object connectionParams) : Jaxer.DB.MySQL.ConnectionCreates a new connection to the given databaseName. The resulting connection object is the only way to interact with the database. Parameters
Returns
|
Properties
Property | Action | Jaxer Server Framework | Jaxer Client Framework |
---|---|---|---|
Returns the string identifying the database implementation of this connection. You can compare this e.g. to Jaxer.DB.SQLite.IMPLEMENTATION
or Jaxer.DB.MySQL.IMPLEMENTATION
|
No Details | 1.0 | no |
|
|||
Is the connection currently open? Recall that even if the answer is no the connection would automatically be opened when needed.
|
No Details | 1.0 | no |
|
|||
Returns the unique ID used for an AUTO_INCREMENT column in the most recent successful INSERT command on the current connection.
If no successful INSERTs have ever occurred on this connection, 0 is returned. Note that unsuccessful INSERTs do not change
this value. This is a synonym for lastInsertRowId. See http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html for more
details.
|
No Details | 1.0 | no |
|
|||
Returns the unique ID used for an AUTO_INCREMENT column in the most recent successful INSERT command on the current connection.
If no successful INSERTs have ever occurred on this connection, 0 is returned. Note that unsuccessful INSERTs do not change
this value. This is a synonym for lastInsertId. See http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html for more
details.
|
No Details | 1.0 | no |
|
|||
Returns the string identifying the version of the database to which you are connected.
|
No Details | 1.0 | no |
|
Functions
Method | Action | Jaxer Server Framework | Jaxer Client Framework | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Closes the connection if it's open. This is optional, and only does something if the connection is open.
|
No Details | 1.0 | no | ||||||||||||
|
|||||||||||||||
execute(String sql, Object params) : Array<Object>|Jaxer.DB.ResultSet|Number
Executes the given sql using the connection. If the SQL includes ?'s (question marks) as parameter placeholders, the values
of those parameters should be passed in as extra arguments to this function, either as individual arguments or as a single
array.
|
Show Details | 1.0 | no | ||||||||||||
Parameters
Returns
|
|||||||||||||||
getLastInsertId() : Number
Returns the unique ID used for an AUTO_INCREMENT column in the most recent successful INSERT command on the current connection.
If no successful INSERTs have ever occurred on this connection, 0 is returned. Note that unsuccessful INSERTs do not change
this value. This is the same as asking for the lastInsertId or lastInsertRowId properties. See http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
for more details.
|
Show Details | 1.0 | no | ||||||||||||
Returns
|
|||||||||||||||
mapExecute(String sql, Array arrayOfParameters, [Object options]) : Array<Object>
Prepares the given SQL query string on the current default database (as defined in configApps.js) and then iteratively executes
it over the given array of parameters.
|
Show Details | 1.0 | no | ||||||||||||
Parameters
Returns
|
|||||||||||||||
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 | 1.0 | no | ||||||||||||
|
|||||||||||||||
test(Boolean keepOpen) : Object
Tests the connection by trying to connect and catching and returning any error encountered. If the connection is successful,
returns a null.
|
Show Details | 1.0 | no | ||||||||||||
Parameters
Returns
|