All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JBMSTours.ApplicationMode

java.lang.Object
   |
   +----JBMSTours.ApplicationMode

public class ApplicationMode
extends Object
Look at the Source.

This class is used by the classes with main methods. It parses the arguments on the command line. If a host name and port number are specified, then the application is a client application and uses the Cloudconnector driver name and Cloudconnector URL. If there is additionally a single character, "r," the application is an RmiJdbc client application, and the correct driver and URL are used. Otherwise, the application is in the embedded mode. The driver name is the standard embedded Cloudscape driver and the URL is the standard Cloudscape URL.

It includes methods for connecting and disconnecting. You can use this to connect to a database. It connects in the correct mode for the application (embedded or client).

It assumes that the name of the database is toursDB. To connect to a different database, supply a value for the property JBMSTours.dbName.


Variable Index

 o CLIENTDRIVER
Cloudconnector client driver name
 o CLOUDCONNECTCLIENT
Cloudconnector client mode
 o EMBEDDED
embedded mode
 o EMBEDDEDDRIVER
embed driver name
 o RMICLIENTDRIVER
RmiJdbc client driver
 o RMIJDBCCLIENT
RmiJdbc client mode

Constructor Index

 o ApplicationMode()
 o ApplicationMode(String, String)
constructor for Cloudconnector client application mode.
 o ApplicationMode(String, String, String)
Constructor for RmiJdbc client application mode
 o ApplicationMode(String[])
Constructor

Method Index

 o connectToCloudscape()
Smart Method for connecting to Cloudscape.
 o connectToCloudscape(String)
Smart Method for connecting to Cloudscape.
 o getDatabaseName()
Returns the database name--either the default, toursDB, or an alternate provided in a JVM property
 o quitCloudscape()
Smart Method for quitting Cloudscape.

Variables

 o EMBEDDED
 public static final short EMBEDDED
embedded mode

 o CLOUDCONNECTCLIENT
 public static final short CLOUDCONNECTCLIENT
Cloudconnector client mode

 o RMIJDBCCLIENT
 public static final short RMIJDBCCLIENT
RmiJdbc client mode

 o EMBEDDEDDRIVER
 public static final String EMBEDDEDDRIVER
embed driver name

 o CLIENTDRIVER
 public static final String CLIENTDRIVER
Cloudconnector client driver name

 o RMICLIENTDRIVER
 public static final String RMICLIENTDRIVER
RmiJdbc client driver

Constructors

 o ApplicationMode
 public ApplicationMode()
 o ApplicationMode
 public ApplicationMode(String hst,
                        String prt)
constructor for Cloudconnector client application mode.

 o ApplicationMode
 public ApplicationMode(String hst,
                        String prt,
                        String r)
Constructor for RmiJdbc client application mode

 o ApplicationMode
 public ApplicationMode(String arg[])
Constructor

Methods

 o getDatabaseName
 public static String getDatabaseName()
Returns the database name--either the default, toursDB, or an alternate provided in a JVM property

Returns:
String database name
 o connectToCloudscape
 public Connection connectToCloudscape(String andAttributes) throws Throwable
Smart Method for connecting to Cloudscape. Knows whether you are embedded or a client. Takes the ;attribute=value portion of the URL as an argument

Parameters:
String - ;attribute=value portion of the URL
Returns:
Connection Connection to the database
Throws: Throwable
if an error occurs
 o connectToCloudscape
 public Connection connectToCloudscape() throws Throwable
Smart Method for connecting to Cloudscape. Knows whether you are embedded or a client. No arguments (no attributes).

Returns:
Connection Connection to the database
Throws: Throwable
if an error occurs
 o quitCloudscape
 public boolean quitCloudscape()
Smart Method for quitting Cloudscape. Knows whether you are embedded or a client. If you are embedded, it shuts down Cloudscape. If not, it doesn't.

Returns:
boolean if the application quit Cloudscape properly

All Packages  Class Hierarchy  This Package  Previous  Next  Index