Download O2 Java Binding Guide

Transcript
Database Management
4.2 Database Management
Database Object
A database must be opened before being accessed and closed at the
end of the database session. To open a database, a Database object
must be created with three parameters: URL, user name and user
password. To set these parameters use the Database constructor, as
illustrated below.
database = new Database(URL,User_Name,User_Passwd);
For example:
database =
new Database("DB_sys:my_server:java_store","john","john_pswd");
Note
The parameter URL has a different syntax according to the underlying
system. The first part is always the type of system (o2, jdbc, sybase,
oracle). The remaining parts are as follows :
- For JB/O2, the URL has the form "o2:server_name:system_name"
where server_name is the name of the o2server (i.e. the name of the
computer on which the o2 server is running) and system_name the
name of the o2 system on which you want to work. The user name and
the password are not taken into account.
database = new Database("o2:the_server:my_system", "", "");
database.connect();
database.open("my_base");
(For further details see the O2 System Administration Manual.)
Java Binding User Manual
51