com.continuent.tungsten.replicator.database
Class SqlStatementParser

java.lang.Object
  extended by com.continuent.tungsten.replicator.database.SqlStatementParser

public class SqlStatementParser
extends java.lang.Object

Handles parsing of SQL statements to derive parsing information. This class encapsulates logic to select a parser based on a particular dialect.

The call to fetch the singleton parser is synchronized to guarantee visibility across all threads. Also, we final variables for all instances to avoid unnecessary object creation, as the parsing function is called potentially many times.


Method Summary
static SqlStatementParser getParser()
          Returns a SQL statement parser.
 SqlOperation parse(java.lang.String statement, java.lang.String dbmsType)
          Parse a SQL statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParser

public static SqlStatementParser getParser()
Returns a SQL statement parser.


parse

public SqlOperation parse(java.lang.String statement,
                          java.lang.String dbmsType)
Parse a SQL statement.

Parameters:
statement - A query, presumably written in some form of SQL
dbmsType - The DBMS type, using one of the string names provided by the Database class.
Returns:
A SqlOperation containing parsing metadata