Consortium    Solutions    Middleware    Forge    MyObjectWeb 
ObjectWeb Consortium
    

Advanced search




RmiJdbc

Project links
· Home
· Download
· Documentation
· Mailing Lists
· Partners
· License
· History

Developers' Corner
· CVS Repository
· ObjectWeb Forge Site

About
· Team
· Contacts

 Documentation 

RmiJdbc 3.0: JDBC 3.0 Driver
Note: Some classes are still missing... SQLData, SQLInput and SQLOutput are not implemented.

Documentation

Browse the detailed documentation, or download it from the download page:
it is located in the doc/ subdirectory of the RmiJdbc distribution.

Architecture

RmiJdbc Server component:

On the server side, a daemon (RJJdbcServer) runs: it offers an RMI server object that implements the whole interface of a JDBC Driver object, and can give access to any JDBC Driver registered in the JDBC DriverManager on the server side.

RmiJdbc JDBC Driver:

The RmiJdbc JDBC Driver runs on the client side: the JDBC classes it implements contact the RmiJdbc Server to access databases.

Quick Start

Unpack the RmiJdbc package:

  • If you download the RmiJdbc.zip package, use unzip RmiJdbc.zip, or a graphical zip tool like WinZip.
  • If you download the RmiJdbc.tar.gz package, use tar xvzf RmiJdbc.zip (mainly for Unix users).

Make your CLASSPATH variable point on the RmiJdbc.jar package: it is located in the dist/lib subdirectory of the RmiJdbc distribution.

  • Unix example (bash style):
    export CLASSPATH=$CLASSPATH:/usr/local/RmiJdbc/dist/lib/RmiJdbc.jar
  • Windows example:
    set CLASSPATH=%CLASSPATH%;C:\RmiJdbc\dist\lib\RmiJdbc.jar

Start the RmiJdbc Server component:

java org.objectweb.rmijdbc.RJJdbcServer [-noreg] [-port regportnum] [-lp portnum] [-sm] [-ssl] [driverList]

Options:

  • -noreg: means you launch the RmiJdbc server with an external rmiregistry.
  • -port regportnum: specify the rmiregistry port (optional, useful if you launch rmiregistry on a port of your own).
  • -lp portnum: specify the listener port for remote objects (optional, useful if need to use a single port for remote objects - otherwise, dynamically allocated ports are used).
  • -sm: use the standard RMI SecurityManager (otherwise, a relaxed SecurityManager is used, equivalent to the RMI SecurityManager with AllPermissions set).
  • -ssl: use in SSL mode (see documentation for details).
  • driverList: list of JDBC Driver classes available on your server (ex. org.enhydra.instantdb.jdbc.idbDriver). You can also declare your driver list in the jdbc.drivers system property (java -Djdbc.drivers=driverList RmiJdbc.RJJdbcServer).

Then, a remote JDBC client can access your local database!
See the code example for more details.

The JDBC URL format used for RmiJdbc is:

 jdbc:rmi://<rmihostname[:port]>/<jdbc-url>

where:

  • rmihostname is the name or IP address of the host where the RmiJdbc server runs.
  • port is the port number for the RMI registry (default 1099, otherwise use the port number specified in the "-port" option on the server side).
  • jdbc-url is the local JDBC URL used on the server to reach the database (for example, a "jdbc:odbc:DSN" URL if the JDBC/ODBC bridge is used).

Troubleshooting

See the FAQ/Release Notes page, the answer should be there.

Full-featured Examples

Some examples to help you get started!

Limitations

Some JDBC 2 classes are still missing: SQLData, SQLInput and SQLOutput are not yet implemented.
RmiJdbc in APPLETs may not work on some platforms, specially if you have old web browsers.
ResultSet's getObject() methods can only return serializable objects (due to RMI distribution).


Copyright © 1999-2003, ObjectWeb Consortium | contact | webmaster | Last modified at 2003-07-24 09:29 PM