Java sql parser with antlr

This question already has an answer here:

  • antlr4 sql grammar 1 answer

I need in simple ANSI SQL parser and am looking for some instant solution. Does antlr have SQL grammar out of the box or should I write it on my own from scratch?

-------------Problems Reply------------

Have a look at this site. It has a java solution

http://jsqlparser.sourceforge.net/home.php

Johan

Here is an SQLite grammar for ANTLR4

https://github.com/antlr/grammars-v4/blob/master/sqlite/SQLite.g4

Category:java Views:2 Time:2018-08-02
Tags: sql java

Related post

  • How do I make the code @header and @members be in Lexer not Parser with ANTLR? 2011-12-30

    Let's say I have a grammar file with this code. // START:members @header { using System.Collections.Generic; } @members { public static Dictionary<string, string> memory = new Dictionary<string, string>(); } ANTLR puts the code in Parser

  • Markdown blockquote parsing with ANTLR 2010-01-12

    This has been something that's been bothering me for a while. How does one go about parsing the following text into the HTML below using ANTLR? I can't seem to wrap my head around this at all. Any Ideas? Markdown: > first line > second line

  • How to write a simple Lexer/Parser with antlr 2.7? 2010-04-22

    I have a complex grammar (in antlr 2.7) which I need to extend. Having never used antlr before, I wanted to write a very simple Lexer and Parser first. I found a very good explanation for antlr3 and tried to adapt it: header{ #include <iostream

  • Java CSV parser with string separator (multi-character) 2011-12-28

    Is there any Java open source library that supports multi-character (i.e., String with length > 1) separators (delimiters) for CSV? By definition, CSV = Comma-Separated Values data with a single character (',') as the delimiter. However, many othe

  • Java web parser with cookies? 2014-11-24

    There are some html parsing libraries available, but what do you do if you need to authenticate, and carry the cookies with each request? And generally what if you need to press some button in order to get the content that you want to parse, for exam

  • How to analyze Java source files with Clojure 2012-02-21

    I'm trying to analyze Java source files with Clojure but I couldn't find a way to do that. First, I thought using Eclipse AST plugin(by copying necessary JAR's to my Clojure project) but I gave up after seeing Eclipse AST's API(visitor based walker).

  • Need in SQL parser on Delphi 2009-03-05

    Does anybody know about good SQL parser with sources, written in Delphi? I need in parsing SQL commands (with all new features of Firebird 2.5) into object structure. --------------Solutions------------- Read this article for Delphi SQL Parser, it us

  • Using `java.sql.CallableStatement` many times without closing it 2011-11-04

    I have a java.sql.CallableStatement with 3 parameters, and I need to call it many times, passing different values for the third parameters. What is the right way to do this? I can create a new callable statement each time, but as far as I understand

  • Timezones in SQL DATE vs java.sql.Date 2012-02-08

    I'm getting a bit confused by the behaviour of the SQL DATE data type vs. that of java.sql.Date. Take the following statement, for example: select cast(? as date) -- in most databases select cast(? as date) from dual -- in Oracle Let's prepare and ex

  • JDBC 4's java.sql.Clob.free() method and backwards compatibility 2012-03-13

    I'm investigating an interesting performance issue, where there are no calls to java.sql.Clob.free() on a frequently used resource. This method on Clob was introduced in Java 6 / JDBC 4, so it might well be that this is actually a regression introduc

  • Java static source analysis/parsing (possibly with antlr), what is a good tool to do this? 2010-05-28

    I need to perform static source analysis on Java code. Ideally, I want the system to work out of the box without much modification from me. For example, I have used Antlr in the past, but I spent a lot of time building grammar files and still didn't

  • Parse SQL file with Java and get statements and comments 2011-12-16

    Possible Duplicate: SQL parser library for Java I would like to use ready solution for parsing SQL file. File can contain comments, SQL statements, DDL. I need to get comments, all SQL statements. Doesn anyone know ready solution? I wouldn't like to

  • Get the table name of a specific column with ZQL or similar SQL parser for java 2011-06-14

    I have implemented a system that uses the ZQL library to parse sql statements and retrieve column names and table names. Now I have got an additional requirement that requires me to find which column belongs to which table. If anyone has previous exp

  • SQL parser library for Java 2009-03-19

    Is there a good open-source Java library for parsing SQL statements? If possible, it should be customizable or flexible enough to also be able to parse (or at least ignore) vendor-specific syntax (such as Oracle tablespace definitions or MySQL's LIMI

  • How to use Joda-Time with java.sql.Timestamp 2009-07-01

    I Have a prepared statement INSERT INTO mst(time) VALUES (?); where time is of type Timestamp in a PostgreSQL database. I am inserting a Joda-Time DateTime object, or I should say I am trying to. I can find no way to convert the DateTime object into

  • Merge java.util.date with java.sql.Time 2011-05-10

    I have an extensive DATE-TIME conversion class, but i came across a scenario that i cannot resolve: I have a java.util.date: Tue May 10 00:00:00 BST 2011 I have a java.sql.time: 03:58:44 I need to create a java.util.date: Tue May 10 03:58:44 BST 2011

  • Scala parser combinators vs ANTLR/Java generated parser? 2011-05-15

    I am writing an expression parser for an app written mostly in Scala. I have built AST objects in Scala, and now need to write the parser. I have heard of Scala's built-in parser combinators, and also of ANTLR3, and am wondering: which would provide

  • dbf CREATE TABLE throws java.sql.SQLException: Syntax error: Stopped parse at 2012-01-16

    I have a dbf file, and I can see in the view that types of intersting fields are L ( I suppose it is logical type ) and M (I suppose it's a Memo type) I try to recreate dbf template using dbf_jdbc, like table: private static final String TABLE = "cre

  • Java Tree parser output for ANTLR 2012-04-08

    I've found a sample template in the ANTLR website, its the Javatreeparser.g, which the site says could produce the AST that I need, but since I'm new to ANTLR, how do I make it show? What I've done so far is placing the grammar file together with my

  • JSTL - use formatDate with a java.sql.Timestamp 2012-05-02

    I have a tag with the following: <%@ tag body-content="empty"%> <%@ attribute name="timestamp" required="true" type="java.sql.Timestamp"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://jav

  • How do I combine a java.util.Date object with a java.sql.Time object? 2008-12-05

    I'm pulling back a Date and a Time from a database. They are stored in separate fields, but I would like to combine them into a java.util.Date object that reflects the date/time appropriately. Here is my original approach, but it is flawed. I always

  • Using SQL in Java with package java.sql 2009-03-16

    during a lecture my professor gave examples of several actions involving databases and the java.sql package. These examples were supposed to be uploaded online in a pdf file, but for some reason the names of all functions and class names aren't displ

  • How do I get a list with all reserved words in SQL::Parser? 2009-12-27

    with #!/usr/bin/perl use warnings; use strict; use 5.010; use SQL::Parser; my $parser = SQL::Parser->new( 'ANSI', {RaiseError=>1} ); my $word = 'BETWEEN'; my $success = $parser->feature( 'reserved_words', $word ); $success = $success ? '' :

  • java.sql.SQLException: Io exception: Got minus one from a read call during JDBC connection with oracle 2010-03-02

    Hi I am new to java when I tried to connect oracle with my java sample code I got the above exception My Code is import java.sql.*; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.275 (s). 11 q(s)