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.
