MaxBase (the application), RXDBClient and JRXDBClient (the NetRexx/Java classes) can access data stored on remote computers that are running one or more copies of RXDBServer. RXDBServer uses a text-based, output-only user interface on the server (and even that is completely optional), therefore it can be used also on computers that donīt have a GUI running (such as most Unix machines).
Each RXDBServer instance thatīs running on a given machine can only serve one DB at a time, although many users can be connected at once to the same RXDBServer. For this reason, if you need to set up and maintain several database table servers, you should check out the NetAdmin metaserver.
The question is, now: how can I set things up so that other people can access database tables residing on my machine?
Assuming that you (or the installer) have correctly set your CLASSPATH environment variable so that Java sees the MaxBase classes, just go to the command line, change to the directory where the database is and type the following:
java nrio.RXDBServer -d:[your database] -p:[Port number] and/or other optional parameters. Valid parameters are: -c:comment => description of the database ['_' are substituted with spaces in <comment>, spaces are not allowed] -d:file[.dat] => uses database [file] -l:file => logs all activities to file [file] -p:port => specifies a port for listening -q => operates in quiet mode (no output on stdout) -v => operates in verbose mode (timestamps in log file, if a log file is requested) -s => operates in safe mode (only read operations allowed) -aa:password => grant admin access to requests made with [password] (safe mode). -ar:password => grant read access to requests made with [password] (safe mode). -aw:password => grant write access to requests made with [password] (safe mode). -f:opt_file => a text file containing (one each line) one or more of the above options. -form:file => an .mfr file to be automatically sent to remote clients running MaxBase and accessing this db.
Syntax for the entries in the options file is ITEM=value; valid items are: COMMENT (you can use spaces between words this time) DB_FILE (=filename, with or without the ending .dat extension) LOG_FILE (=filename) TCPIP_PORT QUIET_MODE (can be =YES or =NO only) VERBOSE_MODE (can be =YES or =NO only) SAFE_MODE (can be =YES or =NO only) FORM (=filename) ADMINPASSWORD READPASSWORD WRITEPASSWORD
Why to store options in a file? Because in Unix (and possibly other operating systems) you can obtain a list of processes, complete with their parameters, and this way someone could retrieve a password by simply looking at the parameters for the running DB server. With an option file, you aren't taking this extra risk (provided of course that you don't let users access the option file). Once you have setup your DB server, remote users can access your database right from MaxBase, specifying the correct host name and port number in the DB login sequence. The number of the users that can access a remote database at once is two for the standard edition of MaxBase and unlimited for the extended edition.
A note about passwords: as you may have noticed, you can have three separate passwords for read, write, administration rights while MaxBase only asks you one password. Itīs not a bug: the admin password already contains read and write access rights and, similarly, the write password grants you read access to the database. By giving your users the right paswword you can be sure that they will only be able to do what you want them to.
What if you need to access RXDBServer from machines that don't have a Java Virtual Machine? The source file for RXDBClient is provided in this package (in the maxbase\demo directory), so you can study and port it (you'll see, it's very easy). |