public class tcUtilJDBCOperations
extends java.lang.Object
| Constructor and Description |
|---|
tcUtilJDBCOperations()
Default Constructor
|
tcUtilJDBCOperations(java.lang.String psDriver,
java.lang.String psUrl,
java.lang.String psUsername,
java.lang.String psPassword)
Contructor that sets the parameters for connecting to a database
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getMaxStringValueFromPatternMatch(java.lang.String psTableName,
java.lang.String psColumnName,
java.lang.String psBeforeWildCard,
java.lang.String psAfterWildCard)
Retrieves the maximum value within a group of results that match a
specified as psBeforeWildCard%psAfterWildCard.
|
java.lang.String |
getRandomRow(java.lang.String psTablename,
java.lang.String psColumnname,
java.lang.String psConstraint,
java.lang.String psValue)
Executes a simple select statement to get back a single column from a
single table for a double constraint-value pair If more than one record
is returned, this method returns any one of the records at random.Hence
the name The following query is executed: SELECT columnname FROM
tablename WHERE firstConstraint=firstValue
|
static void |
main(java.lang.String[] args)
Main Method
|
java.lang.String |
selectStatementDoubleConstraints(java.lang.String psTablename,
java.lang.String psColumnname,
java.lang.String psFirstConstraint,
java.lang.String psFirstValue,
java.lang.String psSecondConstraint,
java.lang.String psSecondValue)
Executes a simple select statement to get back a single column from a
single table for a double constraint-value pair If more than one record
is returned, this method returns the first record.The following query
is executed: SELECT columnname FROM tablename WHERE
firstConstraint=firstValue AND secondConstraint=secondValue
|
java.lang.String |
selectStatementSingleConstraint(java.lang.String psTablename,
java.lang.String psColumnname,
java.lang.String psConstraint,
java.lang.String psValue)
Executes a simple select statement to get back a single column from a
single table for a single constraint-value pair If more than one record
is returned, this method returns the first record.The following query
is executed: SELECT columnname FROM tablename WHERE constraint=value
|
public tcUtilJDBCOperations()
public tcUtilJDBCOperations(java.lang.String psDriver,
java.lang.String psUrl,
java.lang.String psUsername,
java.lang.String psPassword)
psDriver - The class name of the jdbc driverpsUrl - The URL of the databasepsUsername - The username required to access the databasepsPassword - The password for the above usernamepublic java.lang.String selectStatementSingleConstraint(java.lang.String psTablename,
java.lang.String psColumnname,
java.lang.String psConstraint,
java.lang.String psValue)
psTablename - The name of the table on which the query is madepsColumnname - The column which is returnedpsConstraint - The constraint column namepsValue - The value of the constraint which is to be matchedpublic java.lang.String selectStatementDoubleConstraints(java.lang.String psTablename,
java.lang.String psColumnname,
java.lang.String psFirstConstraint,
java.lang.String psFirstValue,
java.lang.String psSecondConstraint,
java.lang.String psSecondValue)
psTablename - The name of the table on which the query is madepsColumnname - The column which is returnedpsFirstConstraint - The first constraint column namepsFirstValue - The value of the first constraint which is to be
matchedpsSecondConstraint - The second constraint column namepsSecondValue - The value of the second constraint which is to be
matchedpublic java.lang.String getRandomRow(java.lang.String psTablename,
java.lang.String psColumnname,
java.lang.String psConstraint,
java.lang.String psValue)
psTablename - The name of the table on which the query is madepsColumnname - The column which is returnedpsConstraint - The constraint column namepsValue - The value of the constraint which is to be matchedpublic java.lang.String getMaxStringValueFromPatternMatch(java.lang.String psTableName,
java.lang.String psColumnName,
java.lang.String psBeforeWildCard,
java.lang.String psAfterWildCard)
psTableName - table namepsColumnName - name of the column being checkedpsBeforeWildCard - pattern before wildcard(%)psAfterWildCard - patter after wildcard(%)public static void main(java.lang.String[] args)
args -