DatabaseManager

Parent Previous Next

Data_Access / DatabaseActors
Block Name: DatabaseManager

Code File Location: VisualSim/actor/lib/database/DatabaseManager

Description

A DatabaseManager. When preinitialized, this actor opens a connection to the specified database. When wrapup() is called, it closes the connection. A user of this class can also separately call getConnection() to open a connection, but then that user must also call closeConnection() when finished.

This class polls all available JDBC database drivers until one is willing to open the string given by the database parameter. Depending on the driver, this string may be a URL. Some database drivers are packaged with VisualSim and available from a ModelBuilder process. You can make others available by setting the jdbc.drivers property. For example, when invoking ModelBuilder, do something like this:

     export JAVAFLAGS=-Djdbc.drivers=com.mysql.jdbc.Driver:bad.tast.ourDriver
     $VS/bin/ModelBuilder -verbose
 
The above lists two drivers, in order of preference, separated by a ":". 

More information can be found at http://java.sun.com/j2se/1.5.0/docs/api/java/sql/DriverManager.html.

Parameter

Explanation

Type

Example

database

JDBC connection string to access the database. This always starts with "jdbc:driver", where the specific driver chosen determines how to interpret fields in the rest of the string. For example,

    jdbc:oracle:thin:@mirabilisdesign.com:1521:visualsimdb

specifies a thin client for an Oracle database located at host mirabilisdesign.com, which listens on port 1521. The "VisualSimdb" is the database name. Another example is

    jdbc:mysql://localhost:3306/space
 
which specifies a MySQL database on the local host, where "space" is the name of the database.



userName

User name







 

Created with the Personal Edition of HelpNDoc: Free PDF documentation generator