|
Jala 1.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--jala.db.RamDatabase
Instances of this class represent an in-memory sql database.
Important: You need the h2.jar in directory "lib/ext"
of your helma installation for this library to work, which you can get
at http://www.h2database.com/.
Defined in Database.js
Constructor Summary | |
jala.db.RamDatabase
(<String> name, <String> username, <String> password)
Returns a newly created RamDatabase instance. |
Method Summary | |
void
|
copyTables(<helma.Database> database, <Array> tables)
Copies all tables in the database passed as argument into this embedded database. |
Boolean
|
dropTable(<String> tableName)
Drops the table with the given name |
Boolean
|
dump(<helma.File> file, <Object> props)
Dumps the database schema and data into a file |
helma.Database
|
getConnection(props)
Returns a connection to this database |
String
|
getName()
Returns the name of the database |
String
|
getPassword()
Returns the password of this 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 |
String
|
getUsername()
Returns the username of this database |
Boolean
|
runScript(<helma.File> file, <Object> props, <String> charset, <Boolean> continueOnError)
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(<String> name, <String> username, <String> password)
name
- The name of the database. If not given a private un-named database is created, that can only be accessed through this instance of jala.db.RamDatabase
username
- Optional username (defaults to "sa"). This username is used when creating the database, so the same should be used when creating subsequent instances of jala.db.RamDatabase pointing to a named database.
password
- Optional password (defaults to "").
Method Detail |
void copyTables(<helma.Database> database, <Array> tables)
database
- The database to copy the tables from
tables
- An optional array containing the names of the tables to copy. If not given all tables are copied
Boolean dropTable(<String> tableName)
tableName
- The name of the table
Boolean dump(<helma.File> file, <Object> props)
file
- The file where the database dump will be
props
- Optional object containing connection properties
helma.Database getConnection(props)
An
- optional parameter object containing connection properties to add to the connection Url.
String getName()
String getPassword()
helma.util.ResourceProperties getProperties(<Object> props)
props
- An optional parameter object containing connection properties to add to the connection Url.
String getUrl(<Object> props)
props
- Optional connection properties to add
String getUsername()
Boolean runScript(<helma.File> file, <Object> props, <String> charset, <Boolean> continueOnError)
file
- The script file to run
props
- Optional object containing connection properties
charset
- Optional character set to use (defaults to "UTF-8")
continueOnError
- Optional flag indicating whether to continue on error or not (defaults to false)
void shutdown()
Boolean tableExists(<String> name)
name
- The name of the table
|
Jala 1.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |