Package org.relique.jdbc.csv
Class ClasspathTableReader
- java.lang.Object
-
- org.relique.jdbc.csv.ClasspathTableReader
-
- All Implemented Interfaces:
TableReader
public class ClasspathTableReader extends Object implements TableReader
-
-
Constructor Summary
Constructors Constructor Description ClasspathTableReader(String path, String charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getPath()
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.void
setExtension(String fileExtension)
-
-
-
Method Detail
-
setExtension
public void setExtension(String fileExtension)
-
getPath
public String getPath()
-
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 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:
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 interfaceTableReader
- Parameters:
connection
- JDBC connection.- Returns:
- list of String values containing table names.
- Throws:
SQLException
- if there is a problem creating table name list.
-
-