helma.Database

Object
   |
   +--helma.Database


This class provides access to a relational database through JDBC. There are two convenient ways to create instances of this class.

The first is to use helma.Database.getInstance() to obtain a connection to a DB that is defined in the application's db.properties and managed by Helma. The second way is to define and create a database connection locally using helma.Database.createInstance() and passing it all necessary parameters.

This class provides two ways of interaction: The query() method allows to issue SQL queries, returning a result set. The execute() provides a way to issue SQL statements that do not return a result set.

Database connections allocated by this class are be managed and eventually disposed by Helma.


Defined in Database.js



Constructor Summary
helma.Database(<DbSource> source)
            Constructor for Database objects, providing access through relational databases through JDBC.
 
Methods Summary
 int execute(<String> 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.
 java.sql.Connection getConnection()
           Get the java.sql.Connection for this Database instance.
 String getDriverName()
           Return the name of the JDBC driver used by this Database instance.
 String getName()
           Return the name of the Helma DbSource object.
 String getProductName()
           Returns the lower case name of the underlying database product.
 boolean isMySql()
           Returns true if this is a MySQL database.
 boolean isOracle()
           Returns true if this is an Oracle database.
 boolean isPostgreSql()
           Returns true if this is a PostgreSQL database.
 Array query(<String> sql)
           Executes the given SQL statement.
<static>  helma.Database createInstance(<String> driver, <String> url, <String> name, <String> user, <String> password)
           Create a new Database instance using the given parameters.
<static>  helma.Database getInstance(<String> name)
           Get a Database instance using the Database source defined in the application's db.properties file with the given name.

Constructor Detail

helma.Database

helma.Database(<DbSource> source)

Method Detail

execute

int execute(<String> sql)

getConnection

java.sql.Connection getConnection()

getDriverName

String getDriverName()

getName

String getName()

getProductName

String getProductName()

isMySql

boolean isMySql()

isOracle

boolean isOracle()

isPostgreSql

boolean isPostgreSql()

query

Array query(<String> sql)

createInstance

<static> helma.Database createInstance(<String> driver, <String> url, <String> name, <String> user, <String> password)

getInstance

<static> helma.Database getInstance(<String> name)


Documentation generated by JSDoc on Thu Apr 5 01:59:00 2007