Class ZipFileTableReader

  • All Implemented Interfaces:
    TableReader

    public class ZipFileTableReader
    extends java.lang.Object
    implements TableReader
    Enables reading CSV files packed in a ZIP file as database tables.
    • Constructor Summary

      Constructors 
      Constructor Description
      ZipFileTableReader​(java.lang.String zipFilename, java.lang.String charset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.Reader getReader​(java.sql.Statement statement, java.lang.String tableName)
      Get reader for a database table.
      java.util.List<java.lang.String> getTableNames​(java.sql.Connection connection)
      Returns a list of the names of all tables in the database.
      java.lang.String getZipFilename()  
      void setExtension​(java.lang.String fileExtension)  
      • Methods inherited from class java.lang.Object

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

      • ZipFileTableReader

        public ZipFileTableReader​(java.lang.String zipFilename,
                                  java.lang.String charset)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • setExtension

        public void setExtension​(java.lang.String fileExtension)
      • getZipFilename

        public java.lang.String getZipFilename()
      • getReader

        public java.io.Reader getReader​(java.sql.Statement statement,
                                        java.lang.String tableName)
                                 throws java.sql.SQLException
        Description copied from interface: TableReader
        Get reader for a database table.
        Specified by:
        getReader in interface TableReader
        Parameters:
        statement - JDBC statement being executed.
        tableName - name of database table to read.
        Returns:
        reader for the table, csvjdbc will close the reader itself at the end.
        Throws:
        java.sql.SQLException - if table does not exist or cannot be read.
      • getTableNames

        public java.util.List<java.lang.String> getTableNames​(java.sql.Connection connection)
                                                       throws java.sql.SQLException
        Description copied from interface: TableReader
        Returns a list of the names of all tables in the database.
        Specified by:
        getTableNames in interface TableReader
        Parameters:
        connection - JDBC connection.
        Returns:
        list of String values containing table names.
        Throws:
        java.sql.SQLException - if there is a problem creating table name list.