org.relique.jdbc.csv
Class ZipFileTableReader

java.lang.Object
  extended by org.relique.jdbc.csv.ZipFileTableReader
All Implemented Interfaces:
TableReader

public class ZipFileTableReader
extends Object
implements TableReader

Enables reading CSV files packed in a ZIP file as database tables.


Constructor Summary
ZipFileTableReader(String zipFilename, String charset)
           
 
Method Summary
 Reader getReader(Statement statement, String tableName)
          Get reader for a database table.
 List<String> getTableNames(Connection connection)
          Returns a list of the names of all tables in the database.
 String getZipFilename()
           
 void setExtension(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(String zipFilename,
                          String charset)
                   throws IOException
Throws:
IOException
Method Detail

setExtension

public void setExtension(String fileExtension)

getZipFilename

public String getZipFilename()

getReader

public Reader getReader(Statement statement,
                        String tableName)
                 throws 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:
SQLException - if table does not exist or cannot be read.

getTableNames

public List<String> getTableNames(Connection connection)
                           throws 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:
SQLException - if there is a problem creating table name list.


Copyright © 2016. All rights reserved.