For Q1)  I think it should use SQLSTATE class code of '42' instead of '28'. 
class code '42' is used for syntax error or access rule violation according to the
SQL spec.

Yip

On 9/7/06, Daniel John Debrunner <[EMAIL PROTECTED]> 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.
SQL State 'N/A' ->> SQLInvalidAuthorizationException


Derby currently uses SQL State '28' for access rule violations, the SQL
standard says that's for 'invalid authorization specification' and only
used in statements not supported by Derby.


So:

Q1) Should Derby be using '42' for access rule violations?

Q2) If Derby uses '42' for access rule violations should it throw a
SQLSyntaxErrorException, a NonTransientSQLException, a SQLException or
SQLInvalidAuthorizationException?

Dan.




Reply via email to