hudson.scm
Class DerbyUtils

java.lang.Object
  extended by hudson.scm.DerbyUtils

public class DerbyUtils
extends Object

This class provides certain utility functions for working with the embedded derby database


Field Summary
static String AUTHOR_SELECT
           
static String BASELINE_SELECT
           
static String CHECKSUM_UPDATE
           
static String CREATE_NAME_INDEX
           
static String CREATE_PROJECT_TABLE
           
static String DELTA_SELECT
           
static String DERBY_DB_FOLDER
           
static String DERBY_DRIVER
           
static String DERBY_SYS_HOME_PROPERTY
           
static String DIR_SELECT
           
static String DROP_NAME_INDEX
           
static String DROP_PROJECT_TABLE
           
static String INSERT_MEMBER_RECORD
           
static String PROJECT_SELECT
           
static String SELECT_MEMBER_1
           
 
Constructor Summary
DerbyUtils()
           
 
Method Summary
static boolean createCMProjectTables(Connection db)
          Establishes a fresh set of Integrity SCM cache tables
static Connection createDBConnection(File path)
          Opens a connection to the derby database represented with the File 'path'
static CM_PROJECT getEnum(String name)
          Returns the CM_PROJECT column name for the string column name
static int getRowCount(ResultSet rs)
          This function provides a count of the total number of rows in the ResultSet
static Hashtable<CM_PROJECT,Object> getRowData(ResultSet rs)
          Convenience function that converts a result set row into a Hashtable for easy access
static void loadDerbyDriver()
          Utility function to load the Java DB Driver
static void setDerbySystemDir(File dir)
          Utility function that sets the derby DB home
static void shutdownDB(File path)
          Shuts down the embedded derby database represented with the File 'path'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DERBY_DRIVER

public static final String DERBY_DRIVER
See Also:
Constant Field Values

DERBY_SYS_HOME_PROPERTY

public static final String DERBY_SYS_HOME_PROPERTY
See Also:
Constant Field Values

DERBY_DB_FOLDER

public static final String DERBY_DB_FOLDER
See Also:
Constant Field Values

CREATE_PROJECT_TABLE

public static final String CREATE_PROJECT_TABLE

DROP_PROJECT_TABLE

public static final String DROP_PROJECT_TABLE
See Also:
Constant Field Values

CREATE_NAME_INDEX

public static final String CREATE_NAME_INDEX

DROP_NAME_INDEX

public static final String DROP_NAME_INDEX
See Also:
Constant Field Values

SELECT_MEMBER_1

public static final String SELECT_MEMBER_1

INSERT_MEMBER_RECORD

public static final String INSERT_MEMBER_RECORD

BASELINE_SELECT

public static final String BASELINE_SELECT

DELTA_SELECT

public static final String DELTA_SELECT

PROJECT_SELECT

public static final String PROJECT_SELECT

AUTHOR_SELECT

public static final String AUTHOR_SELECT

DIR_SELECT

public static final String DIR_SELECT

CHECKSUM_UPDATE

public static final String CHECKSUM_UPDATE
Constructor Detail

DerbyUtils

public DerbyUtils()
Method Detail

getEnum

public static final CM_PROJECT getEnum(String name)
Returns the CM_PROJECT column name for the string column name

Parameters:
name -
Returns:

setDerbySystemDir

public static void setDerbySystemDir(File dir)
Utility function that sets the derby DB home

Parameters:
dir -

loadDerbyDriver

public static void loadDerbyDriver()
Utility function to load the Java DB Driver


createDBConnection

public static Connection createDBConnection(File path)
                                     throws SQLException
Opens a connection to the derby database represented with the File 'path'

Parameters:
path - Job directory where the derby db will be saved
Returns:
SQL Connection to the derby db
Throws:
SQLException

shutdownDB

public static void shutdownDB(File path)
Shuts down the embedded derby database represented with the File 'path'

Parameters:
path - Job directory where the derby db can be located

createCMProjectTables

public static boolean createCMProjectTables(Connection db)
Establishes a fresh set of Integrity SCM cache tables

Parameters:
db - Derby database connection
Returns:
true/false depending on the success of the operation

getRowData

public static Hashtable<CM_PROJECT,Object> getRowData(ResultSet rs)
                                               throws SQLException,
                                                      IOException
Convenience function that converts a result set row into a Hashtable for easy access

Parameters:
rs - ResultSet row object
Returns:
Hashtable containing the non-null values for each column
Throws:
SQLException
IOException

getRowCount

public static int getRowCount(ResultSet rs)
                       throws SQLException
This function provides a count of the total number of rows in the ResultSet

Parameters:
set -
Returns:
Throws:
SQLException


Copyright © 2004-2012 Hudson. All Rights Reserved.