Package net.sf.jsqlparser.statement

Examples of net.sf.jsqlparser.statement.Statement


  public static SQLVisitor parseQuery(Map map) {
    final String sqlString = readSQL(map);

    final CCJSqlParserManager pm = new CCJSqlParserManager();
    Statement statement = null;
    try {
      statement = pm.parse(new StringReader(sqlString));
    } catch (final JSQLParserException ex) {
      LOG.info("JSQLParserException");
    }
View Full Code Here


* The parser generated by JavaCC
*/
public class CCJSqlParser implements CCJSqlParserConstants {

  final public Statement Statement() throws ParseException {
  Statement stm;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case K_WITH:
    case K_SELECT:
    case 79:
      stm = Select();
View Full Code Here

     * "wct_audit_entry.transaction_id  =  wct_transaction.transaction_id  and                 " +
     * "wct_transaction.user_id  = 164 and  wct_audit_entry.object_id  =                       " +
     * "wct_workflows.active_version_id ";
     */
    StringReader stringReader = new StringReader(longQuery);
    Statement statement = parserManager.parse(stringReader);
    // stringReader = new StringReader(longQuery);
    // Statement statement2 = parserManager.parse(stringReader);
    // stringReader = null;
    // statement2 = null;
    statement = null;
View Full Code Here

    in.close();

    String statement = "";
    int numTests = 0;
    // it seems that the very first parsing takes a while, so I put it aside
    Statement parsedStm = parserManager.parse(new StringReader(statement = (String) statementsList.get(0)));
    TablesNamesFinder tablesNamesFinder = new TablesNamesFinder();
    ArrayList parsedSelects = new ArrayList(NUM_REPS * statementsList.size());
    long time = System.currentTimeMillis();

    // measure the time to parse NUM_REPS times all statements in the 2 files
View Full Code Here

  public AlterTest(String arg0) {
    super(arg0);
  }

  public void testAlterTableAddColumn() throws JSQLParserException {
    Statement stmt = CCJSqlParserUtil.parse("ALTER TABLE mytable ADD COLUMN mycolumn varchar (255)");
    assertTrue(stmt instanceof Alter);
    Alter alter = (Alter)stmt;
    assertEquals("mytable",alter.getTable().getFullyQualifiedName());
    assertEquals("mycolumn", alter.getColumnName());
    assertEquals("varchar (255)", alter.getDataType().toString());
View Full Code Here

    }

    public static PlainSelect parseSqlQuery(String selectStatement) throws IOException {
        CCJSqlParserManager pm = new CCJSqlParserManager();
        Reader reader = new StringReader(selectStatement);
        Statement statement;
        try {
            statement = pm.parse(reader);
        } catch (Exception e) {
            throw new DataSourceException("parsing select statement: " + e.getCause().getMessage(),
                    e);
View Full Code Here

TOP

Related Classes of net.sf.jsqlparser.statement.Statement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.