Daniel John Debrunner wrote:
Lance J. Andersen wrote:

  
Daniel John Debrunner wrote:

    
The SQL standard says that SQL State '42' is for "syntax error or access
rule violation" (section 23.1).

JDBC 4.0 states in section 6.5.1 that "TABLE 6-1 specifies which
NonTransientSQLException subclass must be thrown
for a a given SQLState class value:" and Table 6.1 has these two lines
of interest:

SQL State 42 ->> SQLSyntaxErrorException.
      

The javadoc SQLSyntaxErrorException for says:

The subclass of SQLException thrown when the SQLState class value is
'42'. This indicates that the in-progress query has violated SQL syntax
rules.

This somewhat in-conflict with the SQL Standard.

Can a JDBC driver thrown an exception with SQLState '42' and the
exception not be a SQLSyntaxErrorException?
  
Whenever 42 is sent as the SQLState class value it should map to SQLSyntaxErrorException.

I need to clarify the javadocs a bit, but it already indicates that this is the exception when the value of 42 is returned.


Thanks,
Dan.



  

Reply via email to