Package org.relique.jdbc.csv
Class ZipFileTableReader
- java.lang.Object
-
- org.relique.jdbc.csv.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.ReadergetReader(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.StringgetZipFilename()voidsetExtension(java.lang.String fileExtension)
-
-
-
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.SQLExceptionDescription copied from interface:TableReaderGet reader for a database table.- Specified by:
getReaderin interfaceTableReader- 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.SQLExceptionDescription copied from interface:TableReaderReturns a list of the names of all tables in the database.- Specified by:
getTableNamesin interfaceTableReader- 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.
-
-