public class CsvConnection extends Object implements Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE| Modifier | Constructor and Description |
|---|---|
protected |
CsvConnection(String path,
Properties info,
String urlProperties)
Creates a new CsvConnection that takes the supplied path and properties
|
protected |
CsvConnection(TableReader tableReader,
Properties info,
String urlProperties)
Creates a new database connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Executor executor) |
void |
clearWarnings() |
void |
close() |
void |
commit() |
Array |
createArrayOf(String typeName,
Object[] elements) |
Blob |
createBlob() |
Clob |
createClob() |
NClob |
createNClob() |
SQLXML |
createSQLXML() |
Statement |
createStatement() |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency) |
Statement |
createStatement(int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
Struct |
createStruct(String typeName,
Object[] attributes) |
boolean |
getAutoCommit() |
String |
getCatalog() |
protected String |
getCharset()
Accessor method for the charset property
|
Properties |
getClientInfo() |
String |
getClientInfo(String name) |
String |
getColumnTypes(String tableName) |
String |
getCommentChar() |
String |
getDateFormat() |
CryptoFilter |
getDecryptingCodec() |
protected String |
getExtension()
Accessor method for the extension property
|
String |
getFileNamePattern() |
ArrayList<int[]> |
getFixedWidthColumns() |
String |
getHeaderline(String tableName)
Accessor method for the headerline property
|
int |
getHoldability() |
Locale |
getLocale() |
DatabaseMetaData |
getMetaData() |
String |
getMissingValue() |
String[] |
getNameParts() |
int |
getNetworkTimeout() |
protected String |
getPath()
Accessor method for the path property
|
Character |
getQuotechar()
Accessor method for the quotechar property
|
String |
getQuoteStyle() |
String |
getSchema() |
protected String |
getSeparator()
Accessor method for the separator property
|
protected int |
getSkipLeadingDataLines()
Accessor method for skipLeadingDataLines property.
|
int |
getSkipLeadingLines() |
HashMap<String,Method> |
getSqlFunctions() |
List<String> |
getTableNames()
Get list of table names (all files in the directory with the correct
suffix).
|
protected TableReader |
getTableReader() |
String |
getTimeFormat() |
String |
getTimestampFormat() |
String |
getTimeZoneName() |
int |
getTransactionIsolation() |
int |
getTransposedFieldsToSkip() |
int |
getTransposedLines() |
boolean |
getTrimHeaders()
Accessor method for the trimHeaders property
|
boolean |
getTrimValues() |
Map<String,Class<?>> |
getTypeMap() |
protected String |
getURL() |
SQLWarning |
getWarnings() |
boolean |
isClosed() |
protected boolean |
isDefectiveHeaders()
Accessor method for defectiveHeaders property.
|
boolean |
isFileTailPrepend() |
protected boolean |
isHeaderFixedWidth() |
boolean |
isIgnoreUnparseableLines() |
boolean |
isIndexedFiles() |
boolean |
isReadOnly() |
protected boolean |
isSuppressHeaders()
Accessor method for the suppressHeaders property
|
boolean |
isValid(int timeout) |
boolean |
isWrapperFor(Class<?> arg0) |
String |
nativeSQL(String sql) |
CallableStatement |
prepareCall(String sql) |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency) |
CallableStatement |
prepareCall(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatement |
prepareStatement(String sql) |
PreparedStatement |
prepareStatement(String sql,
int autoGeneratedKeys) |
PreparedStatement |
prepareStatement(String sql,
int[] columnIndexes) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency) |
PreparedStatement |
prepareStatement(String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability) |
PreparedStatement |
prepareStatement(String sql,
String[] columnNames) |
void |
releaseSavepoint(Savepoint savePoint) |
void |
removeStatement(Statement statement)
Remove closed statement from list of statements for this connection.
|
void |
rollback() |
void |
rollback(Savepoint savePoint) |
void |
setAutoCommit(boolean autoCommit) |
void |
setCatalog(String catalog) |
void |
setClientInfo(Properties arg0) |
void |
setClientInfo(String arg0,
String arg1) |
void |
setColumnTypes(String columnTypes)
Deprecated.
Pass columnTypes when creating driver. To be removed in a
future version.
|
void |
setCommentChar(String value) |
void |
setDateFormat(String dateFormat) |
void |
setFileTailPrepend(boolean fileTailPrepend) |
void |
setHoldability(int holdability) |
void |
setIgnoreUnparseableLines(boolean ignoreUnparseableLines) |
void |
setIndexedFiles(boolean indexedFiles)
Deprecated.
Pass indexedFiles when creating driver. To be removed in a
future version.
|
void |
setMissingValue(String missingValue) |
void |
setNetworkTimeout(Executor executor,
int milliseconds) |
void |
setReadOnly(boolean readOnly) |
Savepoint |
setSavepoint() |
Savepoint |
setSavepoint(String name) |
void |
setSchema(String schema) |
void |
setSkipLeadingLines(int skipLeadingLines) |
void |
setTimeFormat(String timeFormat) |
void |
setTimestampFormat(String timestampFormat) |
void |
setTransactionIsolation(int level) |
void |
setTransposedFieldsToSkip(int i) |
void |
setTypeMap(Map<String,Class<?>> map) |
<T> T |
unwrap(Class<T> arg0) |
protected CsvConnection(String path, Properties info, String urlProperties) throws SQLException
path - directory where the CSV files are locatedinfo - set of properties containing custom optionsurlProperties - part of connection URL containing connection properties.SQLException - if connection cannot be created.protected CsvConnection(TableReader tableReader, Properties info, String urlProperties) throws SQLException
tableReader - user-provided class to return contents of each database table.info - set of properties containing custom options.urlProperties - part of connection URL containing connection properties.SQLException - if connection cannot be created.public String getQuoteStyle()
public String getTimeZoneName()
public Locale getLocale()
public Statement createStatement() throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic String nativeSQL(String sql) throws SQLException
nativeSQL in interface ConnectionSQLExceptionpublic void setAutoCommit(boolean autoCommit)
throws SQLException
setAutoCommit in interface ConnectionSQLExceptionpublic boolean getAutoCommit()
throws SQLException
getAutoCommit in interface ConnectionSQLExceptionpublic void commit()
throws SQLException
commit in interface ConnectionSQLExceptionpublic void rollback()
throws SQLException
rollback in interface ConnectionSQLExceptionpublic void close()
throws SQLException
close in interface AutoCloseableclose in interface ConnectionSQLExceptionpublic void removeStatement(Statement statement)
statement - statement to be removed.public boolean isClosed()
throws SQLException
isClosed in interface ConnectionSQLExceptionpublic DatabaseMetaData getMetaData() throws SQLException
getMetaData in interface ConnectionSQLExceptionpublic void setReadOnly(boolean readOnly)
throws SQLException
setReadOnly in interface ConnectionSQLExceptionpublic boolean isReadOnly()
throws SQLException
isReadOnly in interface ConnectionSQLExceptionpublic void setCatalog(String catalog) throws SQLException
setCatalog in interface ConnectionSQLExceptionpublic String getCatalog() throws SQLException
getCatalog in interface ConnectionSQLExceptionpublic void setTransactionIsolation(int level)
throws SQLException
setTransactionIsolation in interface ConnectionSQLExceptionpublic int getTransactionIsolation()
throws SQLException
getTransactionIsolation in interface ConnectionSQLExceptionpublic SQLWarning getWarnings() throws SQLException
getWarnings in interface ConnectionSQLExceptionpublic void clearWarnings()
throws SQLException
clearWarnings in interface ConnectionSQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic Map<String,Class<?>> getTypeMap() throws SQLException
getTypeMap in interface ConnectionSQLExceptionpublic void setTypeMap(Map<String,Class<?>> map) throws SQLException
setTypeMap in interface ConnectionSQLExceptionpublic void setHoldability(int holdability)
throws SQLException
setHoldability in interface ConnectionSQLExceptionpublic int getHoldability()
throws SQLException
getHoldability in interface ConnectionSQLExceptionpublic Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
createStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
prepareCall in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException
prepareStatement in interface ConnectionSQLExceptionpublic void releaseSavepoint(Savepoint savePoint) throws SQLException
releaseSavepoint in interface ConnectionSQLExceptionpublic void rollback(Savepoint savePoint) throws SQLException
rollback in interface ConnectionSQLExceptionpublic Savepoint setSavepoint() throws SQLException
setSavepoint in interface ConnectionSQLExceptionpublic Savepoint setSavepoint(String name) throws SQLException
setSavepoint in interface ConnectionSQLExceptionprotected String getPath()
protected TableReader getTableReader()
protected String getURL()
protected String getExtension()
protected String getSeparator()
public String getHeaderline(String tableName)
tableName - name of database table.public Character getQuotechar()
protected boolean isSuppressHeaders()
protected boolean isHeaderFixedWidth()
public ArrayList<int[]> getFixedWidthColumns()
protected boolean isDefectiveHeaders()
protected int getSkipLeadingDataLines()
protected String getCharset()
public boolean getTrimHeaders()
public boolean getTrimValues()
public Array createArrayOf(String typeName, Object[] elements) throws SQLException
createArrayOf in interface ConnectionSQLExceptionpublic Blob createBlob() throws SQLException
createBlob in interface ConnectionSQLExceptionpublic Clob createClob() throws SQLException
createClob in interface ConnectionSQLExceptionpublic Struct createStruct(String typeName, Object[] attributes) throws SQLException
createStruct in interface ConnectionSQLExceptionpublic Properties getClientInfo() throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic String getClientInfo(String name) throws SQLException
getClientInfo in interface ConnectionSQLExceptionpublic boolean isValid(int timeout)
throws SQLException
isValid in interface ConnectionSQLExceptionpublic boolean isWrapperFor(Class<?> arg0) throws SQLException
isWrapperFor in interface WrapperSQLExceptionpublic <T> T unwrap(Class<T> arg0) throws SQLException
unwrap in interface WrapperSQLException@Deprecated public void setColumnTypes(String columnTypes)
columnTypes - comma-separated list of data types.@Deprecated public void setIndexedFiles(boolean indexedFiles)
indexedFiles - flag true if indexed files are to be read.public boolean isIndexedFiles()
public String getFileNamePattern()
public String[] getNameParts()
public void setTimestampFormat(String timestampFormat)
public String getTimestampFormat()
public void setDateFormat(String dateFormat)
public String getDateFormat()
public void setTimeFormat(String timeFormat)
public String getTimeFormat()
public void setCommentChar(String value)
public String getCommentChar()
public int getSkipLeadingLines()
public void setSkipLeadingLines(int skipLeadingLines)
skipLeadingLines - the skipLeadingLines to setpublic boolean isIgnoreUnparseableLines()
public void setIgnoreUnparseableLines(boolean ignoreUnparseableLines)
ignoreUnparseableLines - the ignoreUnparseableLines to setpublic String getMissingValue()
public void setMissingValue(String missingValue)
public void setFileTailPrepend(boolean fileTailPrepend)
public boolean isFileTailPrepend()
public CryptoFilter getDecryptingCodec()
public NClob createNClob() throws SQLException
createNClob in interface ConnectionSQLExceptionpublic SQLXML createSQLXML() throws SQLException
createSQLXML in interface ConnectionSQLExceptionpublic void setClientInfo(Properties arg0) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic void setClientInfo(String arg0, String arg1) throws SQLClientInfoException
setClientInfo in interface ConnectionSQLClientInfoExceptionpublic int getNetworkTimeout()
throws SQLException
getNetworkTimeout in interface ConnectionSQLExceptionpublic void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
setNetworkTimeout in interface ConnectionSQLExceptionpublic void abort(Executor executor) throws SQLException
abort in interface ConnectionSQLExceptionpublic String getSchema() throws SQLException
getSchema in interface ConnectionSQLExceptionpublic void setSchema(String schema) throws SQLException
setSchema in interface ConnectionSQLExceptionpublic int getTransposedLines()
public int getTransposedFieldsToSkip()
public void setTransposedFieldsToSkip(int i)
public List<String> getTableNames() throws SQLException
SQLException - if getting list of table names fails.Copyright © 2016. All rights reserved.