|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.cjdbc.scenario.tools.ScenarioUtility
This class defines a ScenarioUtility
Constructor Summary | |
ScenarioUtility()
|
Method Summary | |
static boolean |
checkEquals(java.sql.ResultSet rs1,
java.sql.ResultSet rs2)
Checks if two result sets have the same content |
static java.util.ArrayList |
convertResultSet(java.sql.ResultSet set)
Converts the result set to an array list so can be display |
static Blob |
createBlob(java.lang.String storeFile)
Creates a new blob from a given file |
static boolean |
deleteDir(java.io.File dir)
Completely deletes a directory |
static void |
displayResultOnScreen(java.util.ArrayList result)
Format a result and display it on the screen |
static void |
displayResultOnScreen(java.sql.ResultSet set)
Format a result and display it on the screen |
static void |
displaySingleQueryResult(java.lang.String query,
java.sql.Connection con)
|
static void |
displaySingleQueryResult(java.lang.String query,
java.sql.Connection con,
boolean prepare)
|
static java.util.ArrayList |
getSingleQueryResult(java.lang.String query,
java.sql.Connection con)
Get the result as an arraylist of executing a sql query on a connection |
static java.util.ArrayList |
getSingleQueryResult(java.lang.String query,
java.sql.Connection con,
boolean prepare)
Get the result as an arraylist of executing a sql query on a connection |
static byte[] |
readBinary(java.io.File file)
ReadBinary data from the file. |
static void |
writeBinary(byte[] data,
java.io.File file)
WriteBinary data to the file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScenarioUtility()
Method Detail |
public static java.util.ArrayList getSingleQueryResult(java.lang.String query, java.sql.Connection con, boolean prepare) throws java.lang.Exception
query
- sql querycon
- connection to use to execute the queryprepare
- if set to true, use preparedStatement instead of statement
ArrayList
of the converted ResultSet
java.lang.Exception
- if failspublic static java.util.ArrayList getSingleQueryResult(java.lang.String query, java.sql.Connection con) throws java.lang.Exception
query
- sql querycon
- connection to use to execute the query
ArrayList
of the converted ResultSet
java.lang.Exception
- if failspublic static void displaySingleQueryResult(java.lang.String query, java.sql.Connection con) throws java.lang.Exception
java.lang.Exception
getSingleQueryResult(String, Connection)
public static void displaySingleQueryResult(java.lang.String query, java.sql.Connection con, boolean prepare) throws java.lang.Exception
java.lang.Exception
getSingleQueryResult(String, Connection)
public static void displayResultOnScreen(java.util.ArrayList result)
result
- a converted resultsetpublic static void displayResultOnScreen(java.sql.ResultSet set) throws java.lang.Exception
set
- a ResultSet
java.lang.Exception
- if an error occurspublic static final java.util.ArrayList convertResultSet(java.sql.ResultSet set) throws java.lang.Exception
set
- the result set with data
ArrayList
of data
java.lang.Exception
- if result set is not validpublic static byte[] readBinary(java.io.File file) throws java.io.IOException
file
- file to read from
java.io.IOException
- if read fails from targetpublic static Blob createBlob(java.lang.String storeFile) throws java.lang.Exception
storeFile
- the path to the file to use
Blob
which content is that of the file
java.lang.Exception
- if fails or if cannot find filepublic static void writeBinary(byte[] data, java.io.File file) throws java.io.IOException
data
- to be written to the filefile
- destination target
java.io.IOException
- if write fails on targetpublic static boolean checkEquals(java.sql.ResultSet rs1, java.sql.ResultSet rs2)
rs1
- an open result setrs2
- an open result set
public static boolean deleteDir(java.io.File dir)
dir
- to delete
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |