br.ufg.integrate.wrapper.csv
Class SqlParser

java.lang.Object
  extended by br.ufg.integrate.wrapper.csv.SqlParser

public class SqlParser
extends Object

This is a very crude and SQL simple parser used by the Csv JDBC driver. It only handles SELECT statements in the format "SELECT xxx,yyy,zzz FROM fffff WHERE xxx='123'" The WHERE condition can only be a signle equal condition, on the form COLUMN=VALUE where column is a column from the resultset and value is a quota enclosed expression

Version:
$Id: SqlParser.java,v 1.4 2007/09/19
Author:
Jonathan Ackerman, Juan Pablo Morales, Rogerio Arantes Gaioso

Field Summary
 String[] columnNames
          Description of the Field
 String tableName
          The name of the table
 
Constructor Summary
SqlParser()
           
 
Method Summary
 String[] getColumnNames()
          Gets the columnNames attribute of the SqlParser object
 String getTableName()
          Gets the tableName attribute of the SqlParser object
 String getWhereColumnName()
           
 String getWhereValue()
          Return the value to use on the where column.
 void parse(String sql)
          Set the internal table name and column names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableName

public String tableName
The name of the table

Since:

columnNames

public String[] columnNames
Description of the Field

Since:
Constructor Detail

SqlParser

public SqlParser()
Method Detail

getTableName

public String getTableName()
Gets the tableName attribute of the SqlParser object

Returns:
The tableName value
Since:

getColumnNames

public String[] getColumnNames()
Gets the columnNames attribute of the SqlParser object

Returns:
The columnNames value
Since:

getWhereColumnName

public String getWhereColumnName()

getWhereValue

public String getWhereValue()
Return the value to use on the where column.

Returns:
null if there is no where clause

parse

public void parse(String sql)
           throws Exception
Set the internal table name and column names.

Parameters:
sql - Description of Parameter
Throws:
Exception - Description of Exception
Since:


Copyright © 2008 Rogério Arantes Gaioso. All Rights Reserved.