Class MySqlDataAccessor


  • public class MySqlDataAccessor
    extends java.lang.Object
    Data Accessor to connect to MySql database.
    • Constructor Detail

      • MySqlDataAccessor

        public MySqlDataAccessor​(MySqlUtils.DbEndpoint dbEndpoint)
                          throws java.sql.SQLException
        Production constructor
        Throws:
        java.sql.SQLException
      • MySqlDataAccessor

        public MySqlDataAccessor​(MySqlUtils.DbEndpoint dbEndpoint,
                                 java.sql.Driver mysqlDriver)
        Test constructor
    • Method Detail

      • getDatabaseConnection

        public java.sql.Connection getDatabaseConnection()
                                                  throws java.sql.SQLException
        Returns:
        a JDBC Connection to the database. An existing connection will be reused.
        Throws:
        java.sql.SQLException
      • getPreparedStatement

        public java.sql.PreparedStatement getPreparedStatement​(java.lang.String sql)
                                                        throws java.sql.SQLException
        Parameters:
        sql - the SQL text to use.
        Returns:
        a PreparedStatement using the supplied SQL text.
        Throws:
        java.sql.SQLException