You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by DS <de...@aline-consulting.com> on 2019/11/18 12:42:20 UTC

IgniteSQLException

    catch (Exception e) {
      ///System.out.println(superCache.err);
      if (e instanceof CacheException) {
        IgniteSQLException sqLEx = X.cause(e, IgniteSQLException.class);
        System.out.println(">>>>> statusCode " + sqLEx.statusCode()); 
    }


I am trying to fetch the exact string for the sql statusCode.
But i am getting statusCode :1001 (parsing error ) for both wrong SQL syntax 
and table does not exist(3001). 

>>>>P.S
I am trying to understand how SQL error works. and how to caputure precise
string for particular statusCode.
eg :

CACHE_NOT_FOUND	                4006
COLUMN_ALREADY_EXISTS	3009




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

RE: RE: IgniteSQLException

Posted by Alexandr Shapkin <le...@gmail.com>.
Jira ticket <https://issues.apache.org/jira/browse/IGNITE-12381>







 **From:**[Alexandr Shapkin](mailto:lexwert@gmail.com)  
 **Sent:** Monday, November 18, 2019 4:44 PM  
 **To:**[user@ignite.apache.org](mailto:user@ignite.apache.org)  
 **Subject:** RE: IgniteSQLException



If you take a look at QueryParser#parseH2 then you can see the following
statement:



    
    
     **catch** (IgniteCheckedException | SQLException e) {  
        **throw new** IgniteSQLException( **" Failed to parse query. " **+ e.getMessage(), IgniteQueryErrorCode.PARSING, e);  
    }



So any exception on this stage will be considered as a Parsing.

I think it’s ok to translate an h2 exception, say TABLE_OR_VIEW_NOT_FOUND_1 =
42102 into SqlStateCode.

I will check JIRA for that.



 **From:**[DS](mailto:deepika.singh@aline-consulting.com)  
 **Sent:** Monday, November 18, 2019 3:42 PM  
 **To:**[user@ignite.apache.org](mailto:user@ignite.apache.org)  
 **Subject:** IgniteSQLException



    catch (Exception e) {

      ///System.out.println(superCache.err);

      if (e instanceof CacheException) {

        IgniteSQLException sqLEx = X.cause(e, IgniteSQLException.class);

        System.out.println(">>>>> statusCode " \+ sqLEx.statusCode()); 

    }





I am trying to fetch the exact string for the sql statusCode.

But i am getting statusCode :1001 (parsing error ) for both wrong SQL syntax

and table does not exist(3001).



>>>>P.S

I am trying to understand how SQL error works. and how to caputure precise

string for particular statusCode.

eg :



CACHE_NOT_FOUND                  4006

COLUMN_ALREADY_EXISTS    3009









\--

Sent from: http://apache-ignite-users.70518.x6.nabble.com/






RE: IgniteSQLException

Posted by Alexandr Shapkin <le...@gmail.com>.
If you take a look at QueryParser#parseH2 then you can see the following
statement:



    
    
     **catch** (IgniteCheckedException | SQLException e) {  
        **throw new** IgniteSQLException( **" Failed to parse query. " **+ e.getMessage(), IgniteQueryErrorCode.PARSING, e);  
    }



So any exception on this stage will be considered as a Parsing.

I think it’s ok to translate an h2 exception, say TABLE_OR_VIEW_NOT_FOUND_1 =
42102 into SqlStateCode.

I will check JIRA for that.



 **From:**[DS](mailto:deepika.singh@aline-consulting.com)  
 **Sent:** Monday, November 18, 2019 3:42 PM  
 **To:**[user@ignite.apache.org](mailto:user@ignite.apache.org)  
 **Subject:** IgniteSQLException



catch (Exception e) {

///System.out.println(superCache.err);

if (e instanceof CacheException) {

IgniteSQLException sqLEx = X.cause(e, IgniteSQLException.class);

System.out.println(">>>>> statusCode " \+ sqLEx.statusCode());

}





I am trying to fetch the exact string for the sql statusCode.

But i am getting statusCode :1001 (parsing error ) for both wrong SQL syntax

and table does not exist(3001).



>>>>P.S

I am trying to understand how SQL error works. and how to caputure precise

string for particular statusCode.

eg :



CACHE_NOT_FOUND 4006

COLUMN_ALREADY_EXISTS 3009









\--

Sent from: http://apache-ignite-users.70518.x6.nabble.com/