org.relique.jdbc.csv
Class CsvWriter

java.lang.Object
  |
  +--org.relique.jdbc.csv.CsvWriter

public class CsvWriter
extends java.lang.Object

This class is a helper class that handles the reading and parsing of data from a .csv file.

Version:
$Id: CsvWriter.html,v 1.1 2003/05/12 16:19:42 sinisa Exp $
Author:
Jonathan Ackerman
, Sander Brienen , Stuart Mottram (fritto) , Jason Bedell

Constructor Summary
CsvWriter(java.lang.String fileName)
          Constructor for the CsvReader object
CsvWriter(java.lang.String fileName, char separator)
          Insert the method's description here.
 
Method Summary
 void close()
          Description of the Method
protected  boolean createTable(java.lang.String[] colNames, java.lang.String table)
           
 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()
          Description of the Method
protected  java.lang.String[] parseCsvLine(java.lang.String line)
           
protected  boolean updateField(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

CsvWriter

public CsvWriter(java.lang.String fileName)
          throws java.lang.Exception
Constructor for the CsvReader object

Parameters:
fileName - Description of Parameter
Throws:
java.lang.Exception - Description of Exception
Since:

CsvWriter

public CsvWriter(java.lang.String fileName,
                 char separator)
          throws java.lang.Exception
Insert the method's description here. Creation date: (6-11-2001 15:02:42)

Parameters:
fileName - java.lang.String
separator - char
Throws:
java.lang.Exception - The exception description.
Since:
Method Detail

getColumnNames

public java.lang.String[] getColumnNames()
Gets the columnNames attribute of the CsvReader object

Returns:
The columnNames value
Since:

getTableName

public java.lang.String getTableName()

getColumn

public java.lang.String getColumn(int columnIndex)
Get the value of the column at the specified index.

Parameters:
columnIndex - Description of Parameter
Returns:
The column value
Since:

getColumn

public java.lang.String getColumn(java.lang.String columnName)
                           throws java.sql.SQLException
Get value from column at specified name. If the column name is not found, throw an error.

Parameters:
columnName - Description of Parameter
Returns:
The column value
Throws:
java.sql.SQLException - Description of Exception
Since:

next

public boolean next()
             throws java.sql.SQLException,
                    java.io.IOException
Description of the Method

Returns:
Description of the Returned Value
Throws:
java.sql.SQLException - Description of Exception
java.io.IOException
Since:

close

public void close()
Description of the Method

Since:

parseCsvLine

protected java.lang.String[] parseCsvLine(java.lang.String line)
                                   throws java.sql.SQLException
java.sql.SQLException

newLine

protected boolean newLine(java.lang.String[] colNames,
                          java.lang.String[] colValues)
                   throws java.io.IOException
java.io.IOException

createTable

protected boolean createTable(java.lang.String[] colNames,
                              java.lang.String table)
                       throws java.io.IOException
java.io.IOException

updateField

protected boolean updateField(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


Copyright © 2002-2003 Together - the Workgroup. All Rights Reserved.