util.sql.test
Class TestClient

java.lang.Object
  |
  +--util.sql.test.TestClient

public class TestClient
extends java.lang.Object

Test driver to test all functionality of the framework.

Usage: java util.sql.test.TestClient -cp ./sqlFramework.jar;./log4j.jar;./yourDbDriver.jar get | getAll | update | updateAll | failTransaction

Assumes: a USERS table with columns:

  • ID
  • USERNAME
  • F_NAME
  • L_NAME
  • EMAIL

    Since:
    3/19/2002
    Version:
    1.0
    Author:
    Ryan Daigle

    Constructor Summary
    TestClient()
               
     
    Method Summary
    static User[] getAllUsers()
              Get all users
    static User getUser(int userId)
              Get a user with the given user id.
    static void main(java.lang.String[] args)
              The test driver for the sql processor.
    static void updateUser(User user)
              Get all users
    static void updateUsers(User[] users)
              Update all these users.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    TestClient

    public TestClient()
    Method Detail

    main

    public static void main(java.lang.String[] args)
    The test driver for the sql processor.
    Parameters:
    args - the test command

    getUser

    public static User getUser(int userId)
    Get a user with the given user id.
    Parameters:
    userId - the id of the user to get
    Returns:
    the user with the given id

    getAllUsers

    public static User[] getAllUsers()
    Get all users
    Returns:
    all users

    updateUser

    public static void updateUser(User user)
    Get all users
    Returns:
    all users

    updateUsers

    public static void updateUsers(User[] users)
    Update all these users. Merely an example of a transaction.
    Parameters:
    users - the array of users to update