|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.relique.jdbc.csv.CsvWriter
public class CsvWriter
This class is a helper class that handles the reading and parsing of data from a .csv file.
Constructor Summary | |
---|---|
CsvWriter(java.lang.String fileName,
char separator,
java.lang.String extension,
long maxFileSize,
java.lang.String charset,
boolean useQuotes,
boolean useQuotesEscape)
Used with statement. |
Method Summary | |
---|---|
void |
close()
Description of the Method |
protected boolean |
createExtTable(java.lang.String[] colNames,
java.lang.String[] colTypes,
java.lang.String table)
|
protected boolean |
createTable(java.lang.String[] colNames,
java.lang.String table)
|
void |
fillTableColumnNames()
|
java.lang.String |
getColumn(int columnIndex)
Get the value of the column at the specified index. |
java.lang.String |
getColumn(java.lang.String columnName)
Get value from column at specified name. |
java.lang.String[] |
getColumnNames()
Gets the columnNames attribute of the CsvReader object |
java.lang.String |
getTableName()
|
protected boolean |
newLine(java.lang.String[] colNames,
java.lang.String[] colValues)
|
boolean |
next()
|
protected java.lang.String[] |
parseCsvLine(java.lang.String line)
|
protected java.lang.String[] |
parseCsvLineAsHeader(java.lang.String line)
|
void |
setFileName(java.lang.String name)
When use split files, this is used when file name is changed. |
protected boolean |
updateFields(java.lang.String[] colNames,
java.lang.String[] colValues,
java.lang.String[] colWhereNames,
java.lang.String[] colWhereValues)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CsvWriter(java.lang.String fileName, char separator, java.lang.String extension, long maxFileSize, java.lang.String charset, boolean useQuotes, boolean useQuotesEscape) throws java.lang.Exception
fileName
- separator
- extension
- maxFileSize
-
java.lang.Exception
Method Detail |
---|
public void setFileName(java.lang.String name) throws java.lang.Exception
name
-
java.lang.Exception
public void fillTableColumnNames() throws java.lang.Exception
java.lang.Exception
public java.lang.String[] getColumnNames()
public java.lang.String getTableName()
public java.lang.String getColumn(int columnIndex)
columnIndex
- Description of Parameter
public java.lang.String getColumn(java.lang.String columnName) throws java.sql.SQLException
columnName
- Description of Parameter
java.sql.SQLException
- Description of Exceptionpublic boolean next() throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public void close()
protected java.lang.String[] parseCsvLine(java.lang.String line) throws java.sql.SQLException
line
-
java.sql.SQLException
protected java.lang.String[] parseCsvLineAsHeader(java.lang.String line) throws java.sql.SQLException
line
-
java.sql.SQLException
protected boolean newLine(java.lang.String[] colNames, java.lang.String[] colValues) throws java.io.IOException
java.io.IOException
protected boolean createTable(java.lang.String[] colNames, java.lang.String table) throws java.io.IOException
java.io.IOException
protected boolean createExtTable(java.lang.String[] colNames, java.lang.String[] colTypes, java.lang.String table) throws java.io.IOException
java.io.IOException
protected boolean updateFields(java.lang.String[] colNames, java.lang.String[] colValues, java.lang.String[] colWhereNames, java.lang.String[] colWhereValues) throws java.io.IOException, java.sql.SQLException
java.io.IOException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |