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 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)
Uses threads with separate connections to force a deadlock (which displays deadlock info) and query the lock diagnostics VTIs.

The first two threads should deadlock.

 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

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
Uses threads with separate connections to force a deadlock (which displays deadlock info) and query the lock diagnostics VTIs.

The first two threads should deadlock. One of them will be chosen as the victim and display the deadlock error message. The third thread 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