Can I use JDev eSDK to parse Oracle SQL?

Is it possible to use oracle.javatools.db and oracle.javatools.db.sql to parse a sql?
import oracle.javatools.db.*;
import oracle.javatools.db.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
public class TestParser
public static void main(String[] args)
Connection conn = null;
try {
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:sample", "sample", "sample");
Database db = DatabaseFactory.findOrCreateDatabase("sample", conn);
Schema schema = db.getDefaultSchema();
SQLQuery sql = SQLQueryBuilderFactory.createQuery(db, schema, args[0]);
catch (Exception e) {
} finally {
try {
     if (conn != null)
catch (Exception se) {
Now if run it with a select * from foo, the program will pass, but as soon as I list column names in the select list, like "select bar from foo", the program will fail with the following stack trace:
Exception in thread "main" java.lang.StackOverflowError
at java.lang.StringBuffer.<init>(
at oracle.jdbc.dbaccess.DBError.getMsgKey(
at oracle.jdbc.dbaccess.DBError.findMessage(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.driver.OracleConnection.getMetaData(
at oracle.javatools.db.AbstractDatabase.getConnection(
at oracle.javatools.db.DatabaseFactory.createConnection(
at oracle.javatools.db.AbstractDatabase.reconnect(
at oracle.javatools.db.AbstractDatabase.getConnection(
... Repeat the last three lines
Can someone help me with this issue?


I think I understand the issue as any call to oracle.javatools.db.Database would close the java.sql.Connection it contains and thus causing later calls to try to reconnect and for whatever reason, reconnect always fails.
My question is why is the Connection object closed in the first place?