DBPing (Hyperic HQ Plugin API)
Keywords: org.hyperic.tools.db.DBPing class

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.tools.db
Class DBPing

    java.lang.Object
      org.hyperic.tools.db.DBPing

    public class DBPing

extends java.lang.Object

DBPing is a tool for testing that a given JDBC driver can be loaded an a connection to a database established. In addition, DBPing can run a simple performance test which does the following: 1. Creates a table 2. Inserts records (1000 records by default; this can be overriden) 3. Commits 4. Deletes the records 5. Commits 6. Drops the table DBPing can be run from the command line using the command: java org.hyperic.tools.db.DBPing Your JDBC driver should be in your classpath, as well as the DBPing class. DBPing can also be called directly from another class. To do this instantiate the DBPing class and then call the DBPing.ping() method. The DBPing.speedTest() method call also be used to run a performance test.

Constructor Summary
`DBPing()` Constructs a DBPing class with quiet mode turned on.
`DBPing(boolean quiet)` Constructs a DBPing class with quiet mode turned on or off.

Method Summary
`boolean` | `isQuiet()` Retrieves whether status messages will be printed to System.out.
`static void` | `main(java.lang.String[] args)`
`void` | `operationTest(java.lang.String database)` Runs an operation test by creating a table, creating an index, creating a sequence, creating a trigger, inserting a row of data, updating a row of data and deleting a row of data.
`void` | `operationTest(java.lang.String driver, java.lang.String database)` Runs an operation test by creating a table, creating an index, creating a sequence, creating a trigger, inserting a row of data, updating a row of data and deleting a row of data.
`void` | `operationTest(java.lang.String driver, java.lang.String database, java.lang.String username, java.lang.String password)` Runs an operation test by creating a table, creating an index, creating a sequence, creating a trigger, inserting a row of data, updating a row of data and deleting a row of data.
`void` | `ping(java.lang.String database)` Loads the specified JDBC driver and connects to the specified database.
`void` | `ping(java.lang.String driver, java.lang.String database)` Loads the specified JDBC driver and connects to the specified database.
`void` | `ping(java.lang.String driver, java.lang.String database, java.lang.String username, java.lang.String password)` Loads the specified JDBC driver and connects to the specified database.
`protected void` | `print(char c)`
`protected void` | `print(java.lang.String s)`
`protected void` | `println()`
`protected void` | `println(java.lang.String s)`
`protected void` | `printSuccess()`
`protected void` | `printTime(long time)`
`void` | `setQuiet(boolean quiet)` Sets whether status messages will be printed to System.out.
`long` | `speedTest(java.lang.String driver, java.lang.String database, java.lang.String username, java.lang.String password)` Runs a speed test by creating a table, inserting a specified number of rows into a table, committing, deleting the rows committing and then dropping the table.
`long` | `speedTest(java.lang.String driver, java.lang.String database, java.lang.String username, java.lang.String password, int numrecs)` Runs a speed test by creating a table, inserting a specified number of rows into a table, committing, deleting the rows committing and then dropping the table.
`long` | `speedTest(java.lang.String driver, java.lang.String database, java.lang.String username, java.lang.String password, int numrecs, int threads)` Runs a multi-threaded speed test by creating a table, inserting a specified number of rows into a table, committing, deleting the rows committing and then dropping the table.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DBPing

    public DBPing()

  Constructs a DBPing class with quiet mode turned on.

### DBPing

    public DBPing(boolean quiet)

  Constructs a DBPing class with quiet mode turned on or off.

  Parameters:
    `quiet` - Status messages are sent to std out if true, no message otherwise.

Method Detail

### main

    public static void main(java.lang.String[] args)

### operationTest

    public void operationTest(java.lang.String database)
                       throws java.lang.ClassNotFoundException,
                              java.sql.SQLException

  Runs an operation test by creating a table, creating an index, creating a sequence, creating a trigger, inserting a row of data, updating a row of data and deleting a row of data. All of the created objects are dropped from the database before the method completes.

  Parameters:
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### operationTest

    public void operationTest(java.lang.String driver,
                              java.lang.String database)
                       throws java.lang.ClassNotFoundException,
                              java.sql.SQLException

  Runs an operation test by creating a table, creating an index, creating a sequence, creating a trigger, inserting a row of data, updating a row of data and deleting a row of data. All of the created objects are dropped from the database before the method completes.

  Parameters:
    `driver` - The Java class name of the JDBC driver (e.g., "COM.cloudscape.core.JDBCDriver"). This paramater can be null in which case the proper driver is loaded automatically, based on the specified database.
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### operationTest

    public void operationTest(java.lang.String driver,
                              java.lang.String database,
                              java.lang.String username,
                              java.lang.String password)
                       throws java.lang.ClassNotFoundException,
                              java.sql.SQLException

  Runs an operation test by creating a table, creating an index, creating a sequence, creating a trigger, inserting a row of data, updating a row of data and deleting a row of data. All of the created objects are dropped from the database before the method completes.

  Parameters:
    `driver` - The Java class name of the JDBC driver (e.g., "COM.cloudscape.core.JDBCDriver"). This paramater can be null in which case the proper driver is loaded automatically, based on the specified database.
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
    `username` - The username to use when connecting to the database. This value can be null.
    `password` - The password to use when connecting to the database. This value can be null.
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### ping

    public void ping(java.lang.String database)
              throws java.lang.ClassNotFoundException,
                     java.sql.SQLException

  Loads the specified JDBC driver and connects to the specified database.

  Parameters:
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### ping

    public void ping(java.lang.String driver,
                     java.lang.String database)
              throws java.lang.ClassNotFoundException,
                     java.sql.SQLException

  Loads the specified JDBC driver and connects to the specified database.

  Parameters:
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
    `driver` - The Java class name of the JDBC driver (e.g., "COM.cloudscape.core.JDBCDriver").
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### ping

    public void ping(java.lang.String driver,
                     java.lang.String database,
                     java.lang.String username,
                     java.lang.String password)
              throws java.lang.ClassNotFoundException,
                     java.sql.SQLException

  Loads the specified JDBC driver and connects to the specified database.

  Parameters:
    `driver` - The Java class name of the JDBC driver (e.g., "COM.cloudscape.core.JDBCDriver"). This paramater can be null in which case the proper driver is loaded automatically, based on the specified database.
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
    `username` - The username to use when connecting to the database. This value can be null.
    `password` - The password to use when connecting to the database. This value can be null.
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### speedTest

    public long speedTest(java.lang.String driver,
                          java.lang.String database,
                          java.lang.String username,
                          java.lang.String password)
                   throws java.lang.ClassNotFoundException,
                          java.sql.SQLException

  Runs a speed test by creating a table, inserting a specified number of rows into a table, committing, deleting the rows committing and then dropping the table. The created table starts with the phrase DBPING_ and ends with a random number.

  Parameters:
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
    `username` - The username to use when connecting to the database. This value can be null.
    `password` - The password to use when connecting to the database. This value can be null.
    `numrecs` - The number of records to create and delete.
  Returns:
    long The elapsed time in milliseconds that the speed test required.
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### speedTest

    public long speedTest(java.lang.String driver,
                          java.lang.String database,
                          java.lang.String username,
                          java.lang.String password,
                          int numrecs)
                   throws java.lang.ClassNotFoundException,
                          java.sql.SQLException

  Runs a speed test by creating a table, inserting a specified number of rows into a table, committing, deleting the rows committing and then dropping the table. The created table starts with the phrase DBPING_ and ends with a random number.

  Parameters:
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
    `username` - The username to use when connecting to the database. This value can be null.
    `password` - The password to use when connecting to the database. This value can be null.
    `numrecs` - The number of records to create and delete.
  Returns:
    long The elapsed time in milliseconds that the speed test required.
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### speedTest

    public long speedTest(java.lang.String driver,
                          java.lang.String database,
                          java.lang.String username,
                          java.lang.String password,
                          int numrecs,
                          int threads)
                   throws java.lang.ClassNotFoundException,
                          java.sql.SQLException

  Runs a multi-threaded speed test by creating a table, inserting a specified number of rows into a table, committing, deleting the rows committing and then dropping the table. The created table starts with the phrase DBPING_ and ends with a random number.

  Parameters:
    `database` - The JDBC driver connect string (e.g., "jdbc:cloudscape:test")
    `username` - The username to use when connecting to the database. This value can be null.
    `password` - The password to use when connecting to the database. This value can be null.
    `numrecs` - The number of records to create and delete.
    `threads` - The number of threads to use in the speed test.
  Returns:
    long The elapsed time in milliseconds that the speed test required.
  Throws:
    `java.lang.ClassNotFoundException`
    `java.sql.SQLException`

### isQuiet

    public boolean isQuiet()

  Retrieves whether status messages will be printed to System.out.

  Returns:
    boolean true if status messages will be printed, false otherwise.

### setQuiet

    public void setQuiet(boolean quiet)

  Sets whether status messages will be printed to System.out.

  Parameters:
    `quiet` - true if status messages should be printed, false otherwise.

### print

    protected void print(char c)

### print

    protected void print(java.lang.String s)

### println

    protected void println()

### println

    protected void println(java.lang.String s)

### printSuccess

    protected void printSuccess()

### printTime

    protected void printTime(long time)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.