Using the Database Class Utilities,
Page 3 of 3


[top]
[prev]
[next]
Documentation Top
Index for This Book

Forcing Database Class Loading for an Application

Cloudscape provides an application bootstrap program that forces Cloudscape class loading for application-side logic. Use the bootstrap program instead of invoking your application on the command line if the application uses classes stored in the database.

The program is called COM.cloudscape.util.DBClassLoad.

Typically, you would invoke your class like this:

java COM.cloudscape.util.DBClassLoad databaseConnectionURL
    yourclassname
classarguments

The databaseConnectionURL refers to the database in which the classes are stored.

In cases when user authentication is turned on and you are using database-level class loading, you will probably not want to put the user name and password on the command line in the database connection URL. In that case, you can invoke the class like this:

  • Create a “wrapper” class. Don’t store this class in the database.
  • In that wrapper class, ask the user to input his or her user name and password.
  • At this point, you have two choices. Do one of the following:
    • Attach the user name and password to the database connection URL. Create a String array (args) that contains the database connection URL, the class name, and any arguments to your class. Invoke the application like this:

      COM.cloudscape.util.DBClassLoad.main(args);

    • Get a connection to the database first (theConnection), passing in the user name and password. Create a String array (args) for any arguments to your class, then invoke the application like this:

      COM.cloudscape.util.DBClassLoad.invokeMain(theConnection, "yourClassNameString", args);

For more information, see the javadoc for COM.cloudscape.util.DBClassLoad.

[top]
[prev]
[next]


Cloudscape Version 3.0
For technical support, go to: www.cloudscape.com and click Support.
Copyright © 1998 and 1999 Cloudscape, Inc. All rights reserved.