Class 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 database
      static 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 queries
      static void openConnection()
      Opens a connection to the application database.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • dbOperations

        public dbOperations()
    • 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 -