Overview | File | Class | Tree | Index | Help
| Jala 1.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class jala.db.RamDatabase

    Object
       |
       +--jala.db.RamDatabase

Direct Known Subclasses:
  jala.db.FileDatabase

class jala.db.RamDatabase

Instances of this class represent an in-memory sql database.
Important: You need the hsqldb.jar in lib/ext of your helma installation for this library to work, which you can get at http://hsqldb.org/.
Defined in Database.js

Constructor Summary
`jala.db.RamDatabase (<String> name)` Returns a newly created RamDatabase instance.

Method Summary
`void` | `copyTables(<helma.Database> database)` Copies all tables in the database passed as argument into this embedded database.
`Boolean` | `dropTable(<String> tableName)` Drops the table with the given name
`helma.Database` | `getConnection(props)` Returns a connection to this database
`String` | `getName()` Returns the name of the database
`helma.util.ResourceProperties` | `getProperties(<Object> props)` Returns a properties object containing the connection properties for this database.
`String` | `getUrl(<Object> props)` Returns the JDBC Url to connect to this database
`Object` | `runScript(<helma.File> file)` Runs the script file passed as argument in the context of this database.
`void` | `shutdown()` Stops this in-process database by issueing a "SHUTDOWN" sql command.
`Boolean` | `tableExists(<String> name)` Returns true if the table exists already in the database

Constructor Detail

### jala.db.RamDatabase

    jala.db.RamDatabase(<String> name)

Returns a newly created RamDatabase instance.

Parameters:

`name` - The name of the database

Returns:

A newly created instance of RamDatabase

Method Detail

### copyTables

    void copyTables(<helma.Database> database)

Copies all tables in the database passed as argument into this embedded database. If any of the tables already exists in this database, they will be removed before re-created. Please mind that this method ignores any indexes in the source database, but respects the primary key settings.

Parameters:

`database` - The database to copy the tables from

### dropTable

    Boolean dropTable(<String> tableName)

Drops the table with the given name

Parameters:

`tableName` - The name of the table

Returns:

True if the table was successfully dropped, false otherwise

### getConnection

    helma.Database getConnection(props)

Returns a connection to this database

Parameters:

`An` - optional parameter object containing connection properties to add to the connection Url.

Returns:

A connection to this database

### getName

    String getName()

Returns the name of the database

Returns:

The name of the database

### getProperties

    helma.util.ResourceProperties getProperties(<Object> props)

Returns a properties object containing the connection properties for this database.

Parameters:

`props` - An optional parameter object containing connection properties to add to the connection Url.

Returns:

A properties object containing the connection properties

### getUrl

    String getUrl(<Object> props)

Returns the JDBC Url to connect to this database

Parameters:

`props` - Optional connection properties to add

Returns:

The JDBC url to use for connecting to this database

### runScript

    Object runScript(<helma.File> file)

Runs the script file passed as argument in the context of this database. Use this method to eg. create and/or populate a database.

Parameters:

`file` - The script file to run.

### shutdown

    void shutdown()

Stops this in-process database by issueing a "SHUTDOWN" sql command.

### tableExists

    Boolean tableExists(<String> name)

Returns true if the table exists already in the database

Parameters:

`name` - The name of the table

Returns:

True if the table exists, false otherwise

Overview | File | Class | Tree | Index | Help
| Jala 1.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Tue May 29 10:26:15 2007