Package scheduler.util
Class dbOperations
- java.lang.Object
-
- scheduler.util.dbOperations
-
public abstract class dbOperations extends java.lang.ObjectManages all direct connections with the database.
-
-
Field Summary
Fields Modifier and Type Field Description static java.sql.Connectionconnectionprivate static java.lang.StringdatabaseNameprivate static java.lang.Stringdriverprivate static java.lang.StringjdbcUrlprivate static java.lang.Stringlocationprivate static java.lang.Stringpasswordprivate static java.lang.Stringprotocolprivate static java.lang.StringuserNameprivate static java.lang.Stringvendor
-
Constructor Summary
Constructors Constructor Description dbOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseConnection()Closes the connection to the application databasestatic java.sql.ResultSetdbQuery(java.lang.String sqlQuery)Accepts a SQL Query in the form of a string, and sends that to the application database.static voiddbUpdate(java.lang.String sqlStatement)Accepts a SQL Update statement in the form of a string and sends that to the application database.static java.sql.ConnectiongetConnection()Returns the current open connection for use in queriesstatic voidopenConnection()Opens a connection to the application database.
-
-
-
Field Detail
-
protocol
private static final java.lang.String protocol
- See Also:
- Constant Field Values
-
vendor
private static final java.lang.String vendor
- See Also:
- Constant Field Values
-
location
private static final java.lang.String location
- See Also:
- Constant Field Values
-
databaseName
private static final java.lang.String databaseName
- See Also:
- Constant Field Values
-
jdbcUrl
private static final java.lang.String jdbcUrl
- See Also:
- Constant Field Values
-
driver
private static final java.lang.String driver
- See Also:
- Constant Field Values
-
userName
private static final java.lang.String userName
- See Also:
- Constant Field Values
-
password
private static java.lang.String password
-
connection
public static java.sql.Connection connection
-
-
Method Detail
-
openConnection
public static void openConnection()
Opens a connection to the application database.
-
getConnection
public static java.sql.Connection getConnection()
Returns the current open connection for use in queries- Returns:
- the connection to the application database.
-
closeConnection
public static void closeConnection()
Closes the connection to the application database
-
dbQuery
public static java.sql.ResultSet dbQuery(java.lang.String sqlQuery) throws java.sql.SQLExceptionAccepts a SQL Query in the form of a string, and sends that to the application database.- Parameters:
sqlQuery-- Returns:
- Result set if the query had results, Null if the query had no results.
- Throws:
java.sql.SQLException
-
dbUpdate
public static void dbUpdate(java.lang.String sqlStatement)
Accepts a SQL Update statement in the form of a string and sends that to the application database.- Parameters:
sqlStatement-
-
-