Package scheduler.util
Class dbOperations
- java.lang.Object
-
- scheduler.util.dbOperations
-
public abstract class dbOperations extends java.lang.Object
Manages all direct connections with the database.
-
-
Field Summary
Fields Modifier and Type Field Description static java.sql.Connection
connection
private static java.lang.String
databaseName
private static java.lang.String
driver
private static java.lang.String
jdbcUrl
private static java.lang.String
location
private static java.lang.String
password
private static java.lang.String
protocol
private static java.lang.String
userName
private static java.lang.String
vendor
-
Constructor Summary
Constructors Constructor Description dbOperations()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeConnection()
Closes the connection to the application databasestatic java.sql.ResultSet
dbQuery(java.lang.String sqlQuery)
Accepts a SQL Query in the form of a string, and sends that to the application database.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.static java.sql.Connection
getConnection()
Returns the current open connection for use in queriesstatic void
openConnection()
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.SQLException
Accepts 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
-
-
-