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:
- checking a database's consistency
- backing up a database
- turning on built-in users
- turning off built-in users
- making some major changes to data that call some triggers
- forcing a deadlock situation and using the lock diagnostics vtis
When you run this class, you should give it an additional argument specifying the
action that you want:
- check_consistency
- back_up
- built-in_users_on
- built-in_users_off
- rearrange_hotels
- force_deadlock (see specific instructions below in forceDeadlock)
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.
-
ARG1
-
-
ARG2
-
-
ARG3
-
-
ARG4
-
-
ARG5
-
-
ARG6
-
-
mymode
-
-
AdminHelper()
-
-
backUpDatabase(Connection)
- Back up the database.
-
changeSomeHotels(Connection)
- Delete some hotels and insert some new ones (will cause some complex triggers
to fire).
-
checkConsistencyOfAllTables(Connection)
- Runs the consistency checker.
-
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.
-
main(String[])
- Entry point
-
turnOffBuiltInUsers(Connection)
- Turn off built-in user authentication and user authorization.
-
turnOnBuiltInUsers(Connection)
- Turn on built-in user authentication and work with user authorization.
mymode
public ApplicationMode mymode
ARG1
public static final String ARG1
ARG2
public static final String ARG2
ARG3
public static final String ARG3
ARG4
public static final String ARG4
ARG5
public static final String ARG5
ARG6
public static final String ARG6
AdminHelper
public AdminHelper()
main
public static void main(String args[])
- Entry point
- Parameters:
- args - legal arguments for this app (see USAGESTRING)
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.
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
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
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
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
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