All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JBMSTours.AdminHelper

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

public class AdminHelper
extends Object
Look at the Source.

This class allows you to try out a number of different administrative-type activities such as:

When you run this class, you should give it an additional argument specifying the action that you want:

This class has a main() method and can be run from the command-line. For complete instructions on how to run such a class, see the example instructions.


Variable Index

 o ARG1
 o ARG2
 o ARG3
 o ARG4
 o ARG5
 o ARG6
 o ARG7
 o ARG8
 o mymode

Constructor Index

 o AdminHelper()

Method Index

 o backUpDatabase(Connection)
Back up the database.
 o changeSomeHotels(Connection)
Delete some hotels and insert some new ones (will cause some complex triggers to fire).
 o checkConsistencyOfAllTables(Connection)
Runs the consistency checker.
 o forceDeadlock(Connection, ApplicationMode, int)
Force a deadlock (which displays deadlock info) and query the lock diagnostics VTIs.

To use this method, you must run Cloudscape inside a server framework.

 o main(String[])
Entry point
 o turnOffBuiltInUsers(Connection)
Turn off built-in user authentication and user authorization.
 o turnOnBuiltInUsers(Connection)
Turn on built-in user authentication and work with user authorization.

Variables

 o mymode
 public ApplicationMode mymode
 o ARG1
 public static final String ARG1
 o ARG2
 public static final String ARG2
 o ARG3
 public static final String ARG3
 o ARG4
 public static final String ARG4
 o ARG5
 public static final String ARG5
 o ARG6
 public static final String ARG6
 o ARG7
 public static final String ARG7
 o ARG8
 public static final String ARG8

Constructors

 o AdminHelper
 public AdminHelper()

Methods

 o main
 public static void main(String args[])
Entry point

Parameters:
args - legal arguments for this app (see USAGESTRING)
 o checkConsistencyOfAllTables
 public static void checkConsistencyOfAllTables(Connection conn) throws SQLException
Runs the consistency checker.

Parameters:
conn - a connection to the database.
Throws: SQLException
if there is a database error.
 o backUpDatabase
 public static void backUpDatabase(Connection conn) throws SQLException
Back up the database.

Parameters:
conn - a connection to the database.
Throws: SQLException
if there is a database error
 o turnOnBuiltInUsers
 public static void turnOnBuiltInUsers(Connection conn) throws SQLException
Turn on built-in user authentication and work with user authorization.

Parameters:
conn - a connection to the database.
Throws: SQLException
if there is a database error
 o turnOffBuiltInUsers
 public static void turnOffBuiltInUsers(Connection conn) throws SQLException
Turn off built-in user authentication and user authorization.

Parameters:
conn - a connection to the database.
Throws: SQLException
if there is a database error
 o changeSomeHotels
 public static void changeSomeHotels(Connection conn) throws SQLException
Delete some hotels and insert some new ones (will cause some complex triggers to fire).

Parameters:
conn - a connection to the database.
Throws: SQLException
if there is a database error
 o forceDeadlock
 public static void forceDeadlock(Connection conn,
                                  ApplicationMode am,
                                  int role) throws Throwable
Force a deadlock (which displays deadlock info) and query the lock diagnostics VTIs.

To use this method, you must run Cloudscape inside a server framework. Here's what you should do:

  1. Start Cloudscape in the server framework.
  2. Open three command windows, setting class path appropriately in each.
  3. Within a few seconds of each other, do the following:
    1. In the first window, run the program with the arguments ;lthostname;gt ;ltportnumber;gt [r] force_deadlock_a.
    2. In the second window, run the program with the arguments ;lthostname;gt ;ltportnumber;gt [r] force_deadlock_b.
    3. In the third window, run the program with the arguments ;lthostname;gt ;ltportnumber;gt [r] force_deadlock_c.
A and B should deadlock. One of them will be chosen as the victim and display the deadlock error message. C will dump information from the lock diagnostics VTIs.

Parameters:
conn - a connection to the database.
Throws: Throwable
if there is a database error

All Packages  Class Hierarchy  This Package  Previous  Next  Index