Detailed reference of prototypes, properties and methods available in the
Javascript environment of your Helma web applications.

Properties and methods of the helma.Database prototype.

To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/helma/Database.js')
helma Database(source)
Constructor for Database objects, providing access through relational databases through JDBC. It is usually simpler to use one of the factory methods {@link #createInstance} or {@link #getInstance}.
parameters
DbSource source instance of a helma.objectmodel.db.DbSource
methods
Methods
helma.Database. getConnection()
Get the java.sql.Connection for this Database instance. This can be used to operate on the connection directly, without going through the helma.Database class.
returns
java.sql.Connection the JDBC connection
helma.Database. getProductName()
Returns the lower case name of the underlying database product.
returns
String the name of the DB product
helma.Database. isOracle()
Returns true if this is an Oracle database.
returns
boolean true if this is an Oracle database.
helma.Database. isMySql()
Returns true if this is a MySQL database.
returns
boolean true if this is an MySQL database.
helma.Database. isPostgreSql()
Returns true if this is a PostgreSQL database.
returns
boolean true if this is a PostgreSQL database.
helma.Database. query(sql)
Executes the given SQL statement. The result set is returned as JavaScript Array containing a JavaScript Object for each result.
parameters
String sql an SQL query statement
returns
Array an Array containing the result set
helma.Database. execute(sql)
Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL data definition statement. The return value is an integer that indicates the number of rows that were affected by the statement.
parameters
String sql an SQL statement
returns
int either the row count for INSERT, UPDATE or DELETE statements, or 0 for SQL statements that return nothing
helma.Database. getName()
Return the name of the Helma DbSource object.
returns
String the DbSource name
helma.Database. getDriverName()
Return the name of the JDBC driver used by this Database instance.
returns
String the JDBC driver name
helma. Database.createInstance(driver, url, name, user, password)
Create a new Database instance using the given parameters.

Some of the parameters support shortcuts for known database products. The url parameter recognizes the values "mysql", "oracle" and "postgresql". For those databases, it is also possible to pass just hostname or hostname:port as url parameters instead of the full JDBC URL.

parameters
String driver the class name of the JDBC driver. As shortcuts, the values "mysql", "oracle" and "postgresql" are recognized.
String url the JDBC URL.
String name the name of the database to use
String user the the username
String password the password
returns
helma.Database a helma.Database instance
helma. Database.getInstance(name)
Get a Database instance using the Database source defined in the application's db.properties file with the given name.
parameters
String name the name of the DB source as defined in db.properties
returns
helma.Database a helma.Database instance
Fri, 05 Feb 2010 17:40:05 GMT.

core framework

optional modules

java libraries

properties files