|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdb.DBConnect
DAE Class performs basic functions of connecting to the database and retrieving the results from a user query
| Field Summary | |
private static java.lang.String |
CONNECTION_STRING
|
| Constructor Summary | |
DBConnect()
|
|
| Method Summary | |
static void |
closeConnection(java.sql.Connection conn)
Closes the connection object if it is not null |
static void |
closeResults(java.sql.ResultSet rs)
Closes the results object if it is not null |
static void |
closeResultsStatement(java.sql.ResultSet rs)
Closes the statement object from the results object if it is not null |
static void |
closeStatement(java.sql.Statement stmt)
Closes the statement object if it is not null |
static jqubeObjects.DataSet |
conXMLtoDS(java.lang.String xmlString)
Converts the resultset XML to a generic DataSet object consumed in the GUI |
static java.sql.ResultSet |
executeQuery(java.lang.String query,
java.sql.Connection conn)
Executes a query and returns a resultset object. |
static java.lang.String |
getConnectionString()
Gets the connection string stored in the static class variable |
static java.sql.Connection |
makeConnection()
Makes a connection to the DB using the properties file |
static java.lang.String |
makeXML(java.sql.ResultSet rs)
Converts ResultSet to XML |
static int[] |
processBatchInsert(java.util.ArrayList queryList)
Processes a batch insert into the database |
static java.lang.String |
processQuery(java.lang.String query)
Processes the user query and returns the results in XML form suitable for transmission across a network link |
static java.lang.String |
processXMLRequest(java.lang.String xmlString)
Takes the users XML wrapped query received over the network and passes it along to the database and returns the results set from the sucessful query. |
static boolean |
runNonQuery(java.lang.String query)
Run a query that does not return any rows |
static java.sql.ResultSet |
runStatQuery(java.lang.String query)
Runs a query used to get data for statistics calulation purposes |
static void |
setConnectionString(java.lang.String newString)
Sets the static connection string to the passed in value |
static boolean |
testConnection(java.lang.String connectionString)
Test the connection string by attempting to establish a connection with the database |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static java.lang.String CONNECTION_STRING
| Constructor Detail |
public DBConnect()
| Method Detail |
public static void setConnectionString(java.lang.String newString)
newString - the new connection stringpublic static java.lang.String getConnectionString()
public static java.lang.String processXMLRequest(java.lang.String xmlString)
xmlString - The query wrapped in XML
public static int[] processBatchInsert(java.util.ArrayList queryList)
queryList - the list of objects to insert into the database
public static java.lang.String processQuery(java.lang.String query)
query - XML query to pass to the database
public static java.sql.ResultSet executeQuery(java.lang.String query,
java.sql.Connection conn)
throws java.sql.SQLException
query - Regular text query (not XML wrapped)conn - Handle to the database connection
java.sql.SQLException
public static java.sql.Connection makeConnection()
throws java.sql.SQLException,
java.io.IOException,
java.lang.Exception
java.sql.SQLException
java.io.IOException
java.lang.Exceptionpublic static boolean testConnection(java.lang.String connectionString)
connectionString - the string with which to attempt to create the connection
public static java.lang.String makeXML(java.sql.ResultSet rs)
throws org.jdom.JDOMException
rs - results set which to convert
org.jdom.JDOMException
public static jqubeObjects.DataSet conXMLtoDS(java.lang.String xmlString)
throws java.io.IOException,
org.jdom.JDOMException
xmlString - The XML containing all the values and fields that need to be
converted into a DataSet format
java.io.IOException
org.jdom.JDOMExceptionpublic static java.sql.ResultSet runStatQuery(java.lang.String query)
query - the query to run against the database
public static boolean runNonQuery(java.lang.String query)
query - the query to run on the database
public static void closeConnection(java.sql.Connection conn)
conn - connection object to closepublic static void closeStatement(java.sql.Statement stmt)
stmt - statement object to closepublic static void closeResults(java.sql.ResultSet rs)
rs - results set object to closepublic static void closeResultsStatement(java.sql.ResultSet rs)
rs - results set for which to close the associated statement object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||