org.edg.data.util
Class SQLUtils

java.lang.Object
  |
  +--org.edg.data.util.SQLUtils

public final class SQLUtils
extends java.lang.Object

Useful methods for dealing with SQL

Version:
$Id: SQLUtils.java,v 1.28 2004/04/15 12:40:42 jamesc Exp $
Author:
James Casey, Sophie Lemaitre

Field Summary
static java.lang.String VENDOR_MYSQL
           
static java.lang.String VENDOR_ORACLE
           
 
Constructor Summary
SQLUtils()
           
 
Method Summary
static void addColumn(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName, java.lang.String columnType, java.lang.String vendor)
           
static void cleanup(java.sql.Connection rls)
           
static boolean columnExists(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName, java.lang.String vendor)
          Does a given column exist in a given table ?
static void deleteColumn(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName, java.lang.String vendor)
           
static java.util.List getColumnDefinitions(java.sql.Connection conn, java.lang.String tableName, java.lang.String pattern, java.lang.String vendor)
          return a string[] which contains {name, type} pairs in order where the name matches the given pattern
static java.util.List getColumnNames(java.sql.Connection conn, java.lang.String tableName, java.lang.String pattern, java.lang.String vendor)
          return a string[] which contains column name in order where the name matches the given pattern
static int getColumnSize(ConnectionFactory connFac, java.lang.String tableName, java.lang.String columnName)
           
static int getColumnSize(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName)
           
static java.lang.String getTypeForColumn(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName, java.lang.String vendor)
           
static boolean isDuplicateMessage(java.sql.SQLException e)
          check if the SQL Exception is because of unique key constraint violation
static java.util.List queryFourParamThirdAndFourthIntReturnStringPairList(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2, int param3, int param4)
           
static boolean queryOneParamHasString(java.sql.Connection conn, java.lang.String sql, java.lang.String param)
           
static java.sql.Date queryOneParamIntReturnDate(java.sql.Connection conn, java.lang.String sql, int param)
           
static float queryOneParamIntReturnFloat(java.sql.Connection conn, java.lang.String sql, int param)
           
static int queryOneParamIntReturnInt(java.sql.Connection conn, java.lang.String sql, int param)
           
static java.util.List queryOneParamIntReturnListStringArray(java.sql.Connection conn, java.lang.String sql, int param)
           
static java.lang.String queryOneParamIntReturnString(java.sql.Connection conn, java.lang.String sql, int param)
           
static java.util.List queryOneParamIntReturnStringPairList(java.sql.Connection conn, java.lang.String sql, int param)
           
static java.sql.Timestamp queryOneParamIntReturnTimestamp(java.sql.Connection conn, java.lang.String sql, int param)
           
static java.sql.Date queryOneParamReturnDate(java.sql.Connection conn, java.lang.String sql, java.lang.String param)
           
static int queryOneParamReturnInt(java.sql.Connection conn, java.lang.String sql, java.lang.String param)
           
static java.lang.String queryOneParamReturnString(java.sql.Connection conn, java.lang.String sql, java.lang.String param)
           
static java.util.List queryOneParamReturnStringList(java.sql.Connection conn, java.lang.String sql, java.lang.String param)
           
static java.util.List queryOneParamReturnStringPairList(java.sql.Connection conn, java.lang.String sql, java.lang.String param)
          Execute query which returns a result set where the row is a pair of string.
static int queryReturnInt(java.sql.Connection conn, java.lang.String sql)
           
static java.lang.String queryReturnString(java.sql.Connection conn, java.lang.String sql)
           
static java.util.List queryReturnStringList(java.sql.Connection conn, java.lang.String sql)
           
static java.util.List queryReturnStringPairList(java.sql.Connection conn, java.lang.String sql)
          Execute query which returns a result set where the row is a pair of string.
static java.util.List queryReturnThreeStringsList(java.sql.Connection conn, java.lang.String sql)
           
static java.util.List queryReturnTwoStringsList(java.sql.Connection conn, java.lang.String sql)
           
static java.lang.String queryThreeParamReturnString(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2, java.lang.String param3)
           
static java.util.List queryThreeParamSecondAndThirdIntReturnStringPairList(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, int param2, int param3)
          Execute query which returns a result set where the row is a pair of string.
static java.util.List queryThreeParamThirdIntReturnStringPairList(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2, int param3)
           
static java.util.List queryTwoParamIntReturnListStringArray(java.sql.Connection conn, java.lang.String sql, int param1, int param2)
           
static java.util.List queryTwoParamIntReturnStringPairList(java.sql.Connection conn, java.lang.String sql, int param1, int param2)
           
static int queryTwoParamReturnInt(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2)
           
static java.lang.String queryTwoParamReturnString(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2)
           
static java.util.List queryTwoParamReturnStringList(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2)
           
static java.util.List queryTwoParamReturnStringPairList(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2)
          Execute query which returns a result set where the row is a pair of string.
static java.util.List queryTwoParamSecondIntReturnStringPairList(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, int param2)
          Execute query which returns a result set where the row is a pair of string.
static void rollback(java.lang.String method, java.sql.Connection conn)
           
static java.sql.Date singleDateValue(java.sql.ResultSet rs)
          return the first col of the first row of a ResultSet
static float singleFloatValue(java.sql.ResultSet rs)
          return the first col of the first row of a ResultSet
static int singleIntValue(java.sql.ResultSet rs)
          return the first col of the first row of a ResultSet
static java.sql.Timestamp singleTimestampValue(java.sql.ResultSet rs)
          return the first col of the first row of a ResultSet
static java.lang.String singleValue(java.sql.ResultSet rs)
          return the first col of the first row of a ResultSet
static int update(java.sql.Connection conn, java.lang.String sql)
          do an executeUpdate() with a statement having one parameter
static int updateManyParam(java.sql.Connection conn, java.lang.String sql, java.lang.String[] params)
           
static int updateOneParam(java.sql.Connection conn, java.lang.String sql, java.lang.String param)
           
static int updateOneParamAndNullDate(java.sql.Connection conn, java.lang.String sql, int param2)
           
static int updateOneParamAndNullFloat(java.sql.Connection conn, java.lang.String sql, int param2)
           
static int updateOneParamAndNullInt(java.sql.Connection conn, java.lang.String sql, int param2)
           
static int updateOneParamAndNullString(java.sql.Connection conn, java.lang.String sql, int param2)
           
static int updateThreeParam(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2, java.lang.String param3)
           
static int updateTwoParam(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, java.lang.String param2)
           
static int updateTwoParamFirstAndSecondInt(java.sql.Connection conn, java.lang.String sql, int param1, int param2)
           
static int updateTwoParamFirstFloatAndSecondInt(java.sql.Connection conn, java.lang.String sql, float param1, int param2)
           
static int updateTwoParamFirstInt(java.sql.Connection conn, java.lang.String sql, int param1, java.lang.String param2)
           
static int updateTwoParamFirstTimestampAndSecondInt(java.sql.Connection conn, java.lang.String sql, java.sql.Timestamp param1, int param2)
           
static int updateTwoParamSecondInt(java.sql.Connection conn, java.lang.String sql, java.lang.String param1, int param2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VENDOR_MYSQL

public static final java.lang.String VENDOR_MYSQL
See Also:
Constant Field Values

VENDOR_ORACLE

public static final java.lang.String VENDOR_ORACLE
See Also:
Constant Field Values
Constructor Detail

SQLUtils

public SQLUtils()
Method Detail

update

public static final int update(java.sql.Connection conn,
                               java.lang.String sql)
                        throws java.sql.SQLException
do an executeUpdate() with a statement having one parameter

Parameters:
conn - the connection to use
sql - the string for the PreparedStatement
java.sql.SQLException

updateOneParam

public static final int updateOneParam(java.sql.Connection conn,
                                       java.lang.String sql,
                                       java.lang.String param)
                                throws java.sql.SQLException
java.sql.SQLException

updateTwoParam

public static final int updateTwoParam(java.sql.Connection conn,
                                       java.lang.String sql,
                                       java.lang.String param1,
                                       java.lang.String param2)
                                throws java.sql.SQLException
java.sql.SQLException

updateTwoParamSecondInt

public static final int updateTwoParamSecondInt(java.sql.Connection conn,
                                                java.lang.String sql,
                                                java.lang.String param1,
                                                int param2)
                                         throws java.sql.SQLException
java.sql.SQLException

updateTwoParamFirstInt

public static final int updateTwoParamFirstInt(java.sql.Connection conn,
                                               java.lang.String sql,
                                               int param1,
                                               java.lang.String param2)
                                        throws java.sql.SQLException
java.sql.SQLException

updateTwoParamFirstAndSecondInt

public static final int updateTwoParamFirstAndSecondInt(java.sql.Connection conn,
                                                        java.lang.String sql,
                                                        int param1,
                                                        int param2)
                                                 throws java.sql.SQLException
java.sql.SQLException

updateTwoParamFirstFloatAndSecondInt

public static final int updateTwoParamFirstFloatAndSecondInt(java.sql.Connection conn,
                                                             java.lang.String sql,
                                                             float param1,
                                                             int param2)
                                                      throws java.sql.SQLException
java.sql.SQLException

updateTwoParamFirstTimestampAndSecondInt

public static final int updateTwoParamFirstTimestampAndSecondInt(java.sql.Connection conn,
                                                                 java.lang.String sql,
                                                                 java.sql.Timestamp param1,
                                                                 int param2)
                                                          throws java.sql.SQLException
java.sql.SQLException

updateOneParamAndNullString

public static final int updateOneParamAndNullString(java.sql.Connection conn,
                                                    java.lang.String sql,
                                                    int param2)
                                             throws java.sql.SQLException
java.sql.SQLException

updateOneParamAndNullInt

public static final int updateOneParamAndNullInt(java.sql.Connection conn,
                                                 java.lang.String sql,
                                                 int param2)
                                          throws java.sql.SQLException
java.sql.SQLException

updateOneParamAndNullFloat

public static final int updateOneParamAndNullFloat(java.sql.Connection conn,
                                                   java.lang.String sql,
                                                   int param2)
                                            throws java.sql.SQLException
java.sql.SQLException

updateOneParamAndNullDate

public static final int updateOneParamAndNullDate(java.sql.Connection conn,
                                                  java.lang.String sql,
                                                  int param2)
                                           throws java.sql.SQLException
java.sql.SQLException

updateThreeParam

public static final int updateThreeParam(java.sql.Connection conn,
                                         java.lang.String sql,
                                         java.lang.String param1,
                                         java.lang.String param2,
                                         java.lang.String param3)
                                  throws java.sql.SQLException
java.sql.SQLException

updateManyParam

public static final int updateManyParam(java.sql.Connection conn,
                                        java.lang.String sql,
                                        java.lang.String[] params)
                                 throws java.sql.SQLException
java.sql.SQLException

queryReturnString

public static final java.lang.String queryReturnString(java.sql.Connection conn,
                                                       java.lang.String sql)
                                                throws java.sql.SQLException
java.sql.SQLException

queryReturnInt

public static final int queryReturnInt(java.sql.Connection conn,
                                       java.lang.String sql)
                                throws java.sql.SQLException
java.sql.SQLException

queryOneParamReturnString

public static final java.lang.String queryOneParamReturnString(java.sql.Connection conn,
                                                               java.lang.String sql,
                                                               java.lang.String param)
                                                        throws java.sql.SQLException
java.sql.SQLException

queryOneParamIntReturnString

public static final java.lang.String queryOneParamIntReturnString(java.sql.Connection conn,
                                                                  java.lang.String sql,
                                                                  int param)
                                                           throws java.sql.SQLException
java.sql.SQLException

queryOneParamReturnDate

public static final java.sql.Date queryOneParamReturnDate(java.sql.Connection conn,
                                                          java.lang.String sql,
                                                          java.lang.String param)
                                                   throws java.sql.SQLException
java.sql.SQLException

queryOneParamIntReturnDate

public static final java.sql.Date queryOneParamIntReturnDate(java.sql.Connection conn,
                                                             java.lang.String sql,
                                                             int param)
                                                      throws java.sql.SQLException
java.sql.SQLException

queryOneParamIntReturnTimestamp

public static final java.sql.Timestamp queryOneParamIntReturnTimestamp(java.sql.Connection conn,
                                                                       java.lang.String sql,
                                                                       int param)
                                                                throws java.sql.SQLException
java.sql.SQLException

queryOneParamIntReturnInt

public static final int queryOneParamIntReturnInt(java.sql.Connection conn,
                                                  java.lang.String sql,
                                                  int param)
                                           throws java.sql.SQLException
java.sql.SQLException

queryOneParamIntReturnFloat

public static final float queryOneParamIntReturnFloat(java.sql.Connection conn,
                                                      java.lang.String sql,
                                                      int param)
                                               throws java.sql.SQLException
java.sql.SQLException

queryTwoParamReturnString

public static final java.lang.String queryTwoParamReturnString(java.sql.Connection conn,
                                                               java.lang.String sql,
                                                               java.lang.String param1,
                                                               java.lang.String param2)
                                                        throws java.sql.SQLException
java.sql.SQLException

queryThreeParamReturnString

public static final java.lang.String queryThreeParamReturnString(java.sql.Connection conn,
                                                                 java.lang.String sql,
                                                                 java.lang.String param1,
                                                                 java.lang.String param2,
                                                                 java.lang.String param3)
                                                          throws java.sql.SQLException
java.sql.SQLException

queryOneParamHasString

public static final boolean queryOneParamHasString(java.sql.Connection conn,
                                                   java.lang.String sql,
                                                   java.lang.String param)
                                            throws java.sql.SQLException
java.sql.SQLException

queryOneParamReturnInt

public static final int queryOneParamReturnInt(java.sql.Connection conn,
                                               java.lang.String sql,
                                               java.lang.String param)
                                        throws java.sql.SQLException
java.sql.SQLException

queryTwoParamReturnInt

public static int queryTwoParamReturnInt(java.sql.Connection conn,
                                         java.lang.String sql,
                                         java.lang.String param1,
                                         java.lang.String param2)
                                  throws java.sql.SQLException
java.sql.SQLException

queryReturnStringList

public static java.util.List queryReturnStringList(java.sql.Connection conn,
                                                   java.lang.String sql)
                                            throws java.sql.SQLException
java.sql.SQLException

queryReturnTwoStringsList

public static java.util.List queryReturnTwoStringsList(java.sql.Connection conn,
                                                       java.lang.String sql)
                                                throws java.sql.SQLException
java.sql.SQLException

queryReturnThreeStringsList

public static java.util.List queryReturnThreeStringsList(java.sql.Connection conn,
                                                         java.lang.String sql)
                                                  throws java.sql.SQLException
java.sql.SQLException

queryOneParamReturnStringList

public static final java.util.List queryOneParamReturnStringList(java.sql.Connection conn,
                                                                 java.lang.String sql,
                                                                 java.lang.String param)
                                                          throws java.sql.SQLException
java.sql.SQLException

queryTwoParamReturnStringList

public static final java.util.List queryTwoParamReturnStringList(java.sql.Connection conn,
                                                                 java.lang.String sql,
                                                                 java.lang.String param1,
                                                                 java.lang.String param2)
                                                          throws java.sql.SQLException
java.sql.SQLException

queryReturnStringPairList

public static final java.util.List queryReturnStringPairList(java.sql.Connection conn,
                                                             java.lang.String sql)
                                                      throws java.sql.SQLException
Execute query which returns a result set where the row is a pair of string. Returns a list of all the pairs in the ResultSet. there will be no members in the list if there are no matches. Otherwise there will be an even number, of the form

Parameters:
conn - the rls connection
sql - the sql statement
Returns:
a list of all the string pairs returned
Throws:
java.sql.SQLException

queryOneParamReturnStringPairList

public static final java.util.List queryOneParamReturnStringPairList(java.sql.Connection conn,
                                                                     java.lang.String sql,
                                                                     java.lang.String param)
                                                              throws java.sql.SQLException
Execute query which returns a result set where the row is a pair of string. Returns a list of all the pairs in the ResultSet. there will be no members in the list if there are no matches. Otherwise there will be an even number, of the form

Parameters:
conn - rls the rls connection
sql - the sql statement
param - a paran
Returns:
a list of all the string pairs returned
Throws:
java.sql.SQLException

queryOneParamIntReturnStringPairList

public static final java.util.List queryOneParamIntReturnStringPairList(java.sql.Connection conn,
                                                                        java.lang.String sql,
                                                                        int param)
                                                                 throws java.sql.SQLException
java.sql.SQLException

queryOneParamIntReturnListStringArray

public static java.util.List queryOneParamIntReturnListStringArray(java.sql.Connection conn,
                                                                   java.lang.String sql,
                                                                   int param)
                                                            throws java.sql.SQLException
java.sql.SQLException

queryTwoParamIntReturnListStringArray

public static java.util.List queryTwoParamIntReturnListStringArray(java.sql.Connection conn,
                                                                   java.lang.String sql,
                                                                   int param1,
                                                                   int param2)
                                                            throws java.sql.SQLException
java.sql.SQLException

queryTwoParamReturnStringPairList

public static final java.util.List queryTwoParamReturnStringPairList(java.sql.Connection conn,
                                                                     java.lang.String sql,
                                                                     java.lang.String param1,
                                                                     java.lang.String param2)
                                                              throws java.sql.SQLException
Execute query which returns a result set where the row is a pair of string. Returns a list of all the pairs in the ResultSet. there will be no members in the list if there are no matches. Otherwise there will be an even number, of the form

Parameters:
conn - the connection
sql - the sql statement
param1 - a param
param2 - another param
Returns:
a list of all the string pairs returned
Throws:
java.sql.SQLException

queryTwoParamIntReturnStringPairList

public static final java.util.List queryTwoParamIntReturnStringPairList(java.sql.Connection conn,
                                                                        java.lang.String sql,
                                                                        int param1,
                                                                        int param2)
                                                                 throws java.sql.SQLException
java.sql.SQLException

queryTwoParamSecondIntReturnStringPairList

public static final java.util.List queryTwoParamSecondIntReturnStringPairList(java.sql.Connection conn,
                                                                              java.lang.String sql,
                                                                              java.lang.String param1,
                                                                              int param2)
                                                                       throws java.sql.SQLException
Execute query which returns a result set where the row is a pair of string. Returns a list of all the pairs in the ResultSet. there will be no members in the list if there are no matches. Otherwise there will be an even number, of the form

Parameters:
conn - the connection
sql - the sql statement
param1 - a String param
param2 - an int parameter
Returns:
a list of all the string pairs returned
Throws:
java.sql.SQLException

queryThreeParamSecondAndThirdIntReturnStringPairList

public static final java.util.List queryThreeParamSecondAndThirdIntReturnStringPairList(java.sql.Connection conn,
                                                                                        java.lang.String sql,
                                                                                        java.lang.String param1,
                                                                                        int param2,
                                                                                        int param3)
                                                                                 throws java.sql.SQLException
Execute query which returns a result set where the row is a pair of string. Returns a list of all the pairs in the ResultSet. there will be no members in the list if there are no matches. Otherwise there will be an even number, of the form

Parameters:
conn - the connection
sql - the sql statement
param1 - a String param
param2 - an int parameter
param3 - another int param
Returns:
a list of all the string pairs returned
Throws:
java.sql.SQLException

queryThreeParamThirdIntReturnStringPairList

public static final java.util.List queryThreeParamThirdIntReturnStringPairList(java.sql.Connection conn,
                                                                               java.lang.String sql,
                                                                               java.lang.String param1,
                                                                               java.lang.String param2,
                                                                               int param3)
                                                                        throws java.sql.SQLException
java.sql.SQLException

queryFourParamThirdAndFourthIntReturnStringPairList

public static final java.util.List queryFourParamThirdAndFourthIntReturnStringPairList(java.sql.Connection conn,
                                                                                       java.lang.String sql,
                                                                                       java.lang.String param1,
                                                                                       java.lang.String param2,
                                                                                       int param3,
                                                                                       int param4)
                                                                                throws java.sql.SQLException
java.sql.SQLException

getColumnSize

public static final int getColumnSize(ConnectionFactory connFac,
                                      java.lang.String tableName,
                                      java.lang.String columnName)
                               throws java.sql.SQLException
java.sql.SQLException

getColumnSize

public static final int getColumnSize(java.sql.Connection conn,
                                      java.lang.String tableName,
                                      java.lang.String columnName)
                               throws java.sql.SQLException
java.sql.SQLException

columnExists

public static final boolean columnExists(java.sql.Connection conn,
                                         java.lang.String tableName,
                                         java.lang.String columnName,
                                         java.lang.String vendor)
                                  throws java.sql.SQLException
Does a given column exist in a given table ?

Parameters:
conn -
tableName -
columnName -
vendor -
Returns:
true if the column exists
Throws:
java.sql.SQLException

getTypeForColumn

public static final java.lang.String getTypeForColumn(java.sql.Connection conn,
                                                      java.lang.String tableName,
                                                      java.lang.String columnName,
                                                      java.lang.String vendor)
                                               throws java.sql.SQLException
java.sql.SQLException

getColumnDefinitions

public static final java.util.List getColumnDefinitions(java.sql.Connection conn,
                                                        java.lang.String tableName,
                                                        java.lang.String pattern,
                                                        java.lang.String vendor)
                                                 throws java.sql.SQLException
return a string[] which contains {name, type} pairs in order where the name matches the given pattern

Parameters:
conn - the underlying connection
tableName - name of the table to look in
pattern - the pattern for the columns
vendor - the db vendor
Returns:
the list of name and types
Throws:
java.sql.SQLException - If a problem occurs with the DB

getColumnNames

public static final java.util.List getColumnNames(java.sql.Connection conn,
                                                  java.lang.String tableName,
                                                  java.lang.String pattern,
                                                  java.lang.String vendor)
                                           throws java.sql.SQLException
return a string[] which contains column name in order where the name matches the given pattern

Parameters:
conn - the underlying connection
tableName - name of the table to look in
pattern - the pattern for the columns
vendor - the db vendor
Returns:
the list of name and types
Throws:
java.sql.SQLException - If a problem occurs with the DB

addColumn

public static final void addColumn(java.sql.Connection conn,
                                   java.lang.String tableName,
                                   java.lang.String columnName,
                                   java.lang.String columnType,
                                   java.lang.String vendor)
                            throws java.sql.SQLException
java.sql.SQLException

deleteColumn

public static final void deleteColumn(java.sql.Connection conn,
                                      java.lang.String tableName,
                                      java.lang.String columnName,
                                      java.lang.String vendor)
                               throws java.sql.SQLException
java.sql.SQLException

singleValue

public static final java.lang.String singleValue(java.sql.ResultSet rs)
                                          throws java.sql.SQLException
return the first col of the first row of a ResultSet

java.sql.SQLException

singleIntValue

public static final int singleIntValue(java.sql.ResultSet rs)
                                throws java.sql.SQLException
return the first col of the first row of a ResultSet

java.sql.SQLException

singleFloatValue

public static final float singleFloatValue(java.sql.ResultSet rs)
                                    throws java.sql.SQLException
return the first col of the first row of a ResultSet

java.sql.SQLException

singleDateValue

public static final java.sql.Date singleDateValue(java.sql.ResultSet rs)
                                           throws java.sql.SQLException
return the first col of the first row of a ResultSet

java.sql.SQLException

singleTimestampValue

public static final java.sql.Timestamp singleTimestampValue(java.sql.ResultSet rs)
                                                     throws java.sql.SQLException
return the first col of the first row of a ResultSet

java.sql.SQLException

isDuplicateMessage

public static final boolean isDuplicateMessage(java.sql.SQLException e)
check if the SQL Exception is because of unique key constraint violation

Parameters:
e - the exception
Returns:
true if it is.

cleanup

public static void cleanup(java.sql.Connection rls)

rollback

public static void rollback(java.lang.String method,
                            java.sql.Connection conn)