@@ -41,6 +41,7 @@ this software and associated documentation files (the "Software"), to deal in
4141
4242public class SQLSelect implements SQLStatement {
4343 private static final String SELECT_CLAUSE = "SELECT" ;
44+ private static final String STREAM_CLAUSE = " STREAM " ;
4445 private static final String DISTINCT_CLAUSE = " DISTINCT " ;
4546 private static final String FROM_CLAUSE = " FROM " ;
4647 private static final String WHERE_CLAUSE = " WHERE " ;
@@ -55,13 +56,14 @@ public class SQLSelect implements SQLStatement {
5556 private SQLJoin join ;
5657 private ArrayList <SQLNode > nodes ;
5758
59+ private boolean stream ;
5860 private boolean distinct ;
5961 private boolean entityResult ;
6062 private Table entityTable ;
61- private String SQLErrorText ;
63+ private SQLException sqlException ;
6264
63- public String getSQLErrorText () {
64- return SQLErrorText ;
65+ public SQLException getSQLException () {
66+ return sqlException ;
6567 }
6668
6769 public SQLSelect () {
@@ -79,10 +81,11 @@ public SQLSelect (String sql, Cursor cur, Session s) {
7981 try {
8082 parseSQL (sql , cur , s );
8183 } catch (SQLException e ) {
82- SQLErrorText = e .getSQLErrorText ();
84+ sqlException = e ;
85+ logger .error (e .getClass ().getSimpleName ()+" thrown during parse of sql statement: " +sql );
8386 } catch (Exception e ) {
84- e . printStackTrace ( );
85- SQLErrorText = e . getMessage ( );
87+ sqlException = new SQLException ( e . getMessage () );
88+ logger . error ( e . getClass (). getSimpleName ()+ " thrown during parse of sql statement: " + sql );
8689 }
8790 }
8891
@@ -151,10 +154,13 @@ private final void parseSQL (String s, Cursor cur, Session sn) throws Exception
151154 if (!SQL .startsWith (SELECT_CLAUSE )) {
152155 throw new InvalidSQLStatement ();
153156 }
154- if (SQL .indexOf (DISTINCT_CLAUSE )>6 ) {
157+ if (SQL .indexOf (STREAM_CLAUSE ) >6 ) {
158+ this .stream = true ;
159+ }
160+ if (SQL .indexOf (DISTINCT_CLAUSE ) >6 ) {
155161 this .distinct = true ;
156162 }
157- if (SQL .indexOf (FROM_CLAUSE ) < SELECT_CLAUSE .length ()+ 1 ) {
163+ if (SQL .indexOf (FROM_CLAUSE ) < SELECT_CLAUSE .length () + 1 ) {
158164 throw new MissingFromClause ();
159165 }
160166 if (sql .substring (SELECT_CLAUSE .length (), SQL .indexOf (" FROM " )).trim ().equals ("" )) {
0 commit comments