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.Server

    Object
       |
       +--jala.db.Server

class jala.db.Server

Instances of this class represent a HSQLDB database server hosting up to 10 separate databases, which are accessible via network.
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.Server (<String|Number> address)` Returns a new Server instance.

Method Summary
`void` | `addDatabase(<jala.db.RamDatabase> db, <Object> props)` Adds a database to this server.
`helma.Database` | `getConnection(<String> name, <Object> props)` Returns a connection to a database within this server.
`helma.util.ResourceProperties` | `getProperties(<String> name, <Object> props)` Returns a properties object containing the connection properties of the database with the given name.
`String` | `getUrl(<String> name, <Object> props)` Returns the JDBC Url to use for connections to the specified database.
`Boolean` | `isRunning()` Returns true if the database server is running.
`void` | `start()` Starts the database server.
`void` | `stop()` Stops the database server.

Constructor Detail

### jala.db.Server

    jala.db.Server(<String|Number> address)

Returns a new Server instance.

Parameters:

`address` - Either the IP address or the port number or a combination of both in the form "ip:port". By default the IP address is "127.0.0.1" (aka localhost) and the port is 9001.

Returns:

A newly created Server instance

Method Detail

### addDatabase

    void addDatabase(<jala.db.RamDatabase> db, <Object> props)

Adds a database to this server.

Parameters:

`db` - The database to add

`props` - An optional parameter object containing database properties

### getConnection

    helma.Database getConnection(<String> name, <Object> props)

Returns a connection to a database within this server.

Parameters:

`name` - The name of the database running within this server

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

Returns:

A connection to the specified database

### getProperties

    helma.util.ResourceProperties getProperties(<String> name, <Object> props)

Returns a properties object containing the connection properties of the database with the given name.

Parameters:

`name` - The name of the database

`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(<String> name, <Object> props)

Returns the JDBC Url to use for connections to the specified database.

Parameters:

`name` - An optional name of a database running

`props` - Optional connection properties to add

Returns:

The JDBC Url to use for connecting to a database within this sever

### isRunning

    Boolean isRunning()

Returns true if the database server is running.

Returns:

True if the database server is running

### start

    void start()

Starts the database server. This should be called after all databases have been added.

See:

- addDatabase()

### stop

    void stop()

Stops the database server.

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