Class JDBCSetMatrix<V>

    • Field Detail

      • tableExists

        private boolean tableExists
      • connection

        private transient java.sql.Connection connection
      • resultSet

        private transient java.sql.ResultSet resultSet
      • truncateTableStatement

        private transient java.sql.PreparedStatement truncateTableStatement
      • insertStatement

        private transient java.sql.PreparedStatement insertStatement
      • deleteStatement

        private transient java.sql.PreparedStatement deleteStatement
      • containsKeyStatement

        private transient java.sql.PreparedStatement containsKeyStatement
      • countStatement

        private transient java.sql.PreparedStatement countStatement
      • selectAllStatement

        private transient java.sql.PreparedStatement selectAllStatement
      • dropTableStatement

        private transient java.sql.PreparedStatement dropTableStatement
    • Constructor Detail

      • JDBCSetMatrix

        private JDBCSetMatrix​(java.lang.String url,
                              java.lang.String username,
                              java.lang.String password,
                              java.lang.String tableName,
                              java.lang.String columnName)
                       throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • JDBCSetMatrix

        private JDBCSetMatrix​(java.sql.Connection connection,
                              java.lang.String tableName,
                              java.lang.String columnName)
                       throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • connectToDerby

        public static <V> JDBCSetMatrix<V> connectToDerby()
                                                   throws java.sql.SQLException,
                                                          java.io.IOException
        Throws:
        java.sql.SQLException
        java.io.IOException
      • connectToDerby

        public static <V> JDBCSetMatrix<V> connectToDerby​(java.io.File folderName)
                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToDerby

        public static <V> JDBCSetMatrix<V> connectToDerby​(java.io.File folderName,
                                                          java.lang.String tableName)
                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToH2

        public static <V> JDBCSetMatrix<V> connectToH2()
                                                throws java.sql.SQLException,
                                                       java.io.IOException
        Throws:
        java.sql.SQLException
        java.io.IOException
      • connectToH2

        public static <V> JDBCSetMatrix<V> connectToH2​(java.io.File file)
                                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToH2

        public static <V> JDBCSetMatrix<V> connectToH2​(java.io.File file,
                                                       java.lang.String tableName)
                                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToSQLite

        public static <V> JDBCSetMatrix<V> connectToSQLite()
                                                    throws java.sql.SQLException,
                                                           java.io.IOException
        Throws:
        java.sql.SQLException
        java.io.IOException
      • connectToSQLite

        public static <V> JDBCSetMatrix<V> connectToSQLite​(java.io.File file)
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToSQLite

        public static <V> JDBCSetMatrix<V> connectToSQLite​(java.io.File file,
                                                           java.lang.String tableName)
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToMySQL

        public static <V> JDBCSetMatrix<V> connectToMySQL​(java.lang.String serverName,
                                                          int port,
                                                          java.lang.String username,
                                                          java.lang.String password,
                                                          java.lang.String databaseName,
                                                          java.lang.String tableName,
                                                          java.lang.String columnName)
                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToMySQL

        public static <V> JDBCSetMatrix<V> connectToMySQL​(java.lang.String serverName,
                                                          int port,
                                                          java.lang.String userName,
                                                          java.lang.String password,
                                                          java.lang.String databaseName,
                                                          java.lang.String tableName)
                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToHSQLDB

        public static <V> JDBCSetMatrix<V> connectToHSQLDB()
                                                    throws java.sql.SQLException,
                                                           java.io.IOException
        Throws:
        java.sql.SQLException
        java.io.IOException
      • connectToHSQLDB

        public static <V> JDBCSetMatrix<V> connectToHSQLDB​(java.io.File fileName)
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToHSQLDB

        public static <V> JDBCSetMatrix<V> connectToHSQLDB​(java.io.File fileName,
                                                           java.lang.String tableName)
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToHSQLDB

        public static <V> JDBCSetMatrix<V> connectToHSQLDB​(java.io.File fileName,
                                                           java.lang.String userName,
                                                           java.lang.String password,
                                                           java.lang.String tableName)
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • connectToHSQLDB

        public static <V> JDBCSetMatrix<V> connectToHSQLDB​(java.io.File fileName,
                                                           java.lang.String userName,
                                                           java.lang.String password,
                                                           java.lang.String tableName,
                                                           java.lang.String columnName)
                                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getConnection

        public final java.sql.Connection getConnection()
      • getURL

        public final java.lang.String getURL()
      • getTableName

        public final java.lang.String getTableName()
      • getDatabaseName

        public final java.lang.String getDatabaseName()
      • getKeyClass

        public final java.lang.Class<?> getKeyClass()
      • getKeyColumnName

        public final java.lang.String getKeyColumnName()
      • close

        public final void close()
                         throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • erase

        public final void erase()
                         throws java.io.IOException
        Specified by:
        erase in interface Erasable
        Throws:
        java.io.IOException
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<V>
        Specified by:
        contains in interface java.util.Set<V>
      • beforeWriteObject

        protected void beforeWriteObject​(java.io.ObjectOutputStream os)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • beforeReadObject

        protected void beforeReadObject​(java.io.ObjectInputStream is)
                                 throws java.io.IOException,
                                        java.lang.ClassNotFoundException
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.Flushable
        Throws:
        java.io.IOException
      • createTable

        private final void createTable​(java.lang.String tableName,
                                       java.lang.String columnName)
                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • size

        public final int size()
        Specified by:
        size in interface java.util.Collection<V>
        Specified by:
        size in interface java.util.Set<V>
      • iterator

        public final java.util.Iterator<V> iterator()
        Specified by:
        iterator in interface java.util.Collection<V>
        Specified by:
        iterator in interface java.lang.Iterable<V>
        Specified by:
        iterator in interface java.util.Set<V>