Menu

#356 "EXCEPTION" SQL reserved word

Connection
closed-duplicate
5
2014-08-08
2014-08-06
guerini
No

As "EXCEPTION" is no more a SQL reserved word since SQL-2003, it should be returned by java.sql.DatabaseMetaData.getSQLKeywords()

Discussion

  • John Eberhard

    John Eberhard - 2014-08-06
    • status: open --> closed-duplicate
    • assigned_to: John Eberhard
     
  • John Eberhard

    John Eberhard - 2014-08-06

    This was fixed in January for JDK 1.6 and later. The latest java6/jt400.jar file should have the fix.

    Here is the comment for getSQLKeywords.

    /**
    Returns the list of all of the database's SQL keywords
    that are not also SQL-XXXX keywords. 
    For JDK 1.5 and earlier, SQL-XXXX refers to SQL-92 keywords.
    For JDK 1.6 and later, SQL-XXXX refers to SQL-2003 keywords.
    
    @return     The list of SQL keywords, separated by commas.
    
    @exception  SQLException    This exception is never thrown.
    **/
    
     
  • guerini

    guerini - 2014-08-06

    I've just had a look at source code of com/ibm/as400/access/AS400JDBCDatabaseMetaData.java, new code of 2014/01/24 with "EXCEPTION" keyword in getSQLKeywords() seems to be commented...

     
  • John Eberhard

    John Eberhard - 2014-08-06

    The code is built so that anything with a "/* ifdef JDBC40" comment is compiled for JDBC40 and put into java6/jt400.jar.

    Here's how you can see the keywords for yourself with the java6/jt400.jar file.

    java -cp java6/jt400.jar com.ibm.as400.access.jdbcClient.Main jdbc:as400:SYSTEM USERID PASSWORD

    !SETVAR DMD=CON.getMetaData()
    DMD=SYSTEM

    !CALLMETHOD DMD.getSQLKeywords()
    Call returned ACCORDING,ACCTNG,...,EVERY,EXCEPTION,EXCLUDING,...

     
  • guerini

    guerini - 2014-08-08

    Ok, I was using "standard" jt400.jar! I have tried again with java6/jt400.jar and java8/jt400.jar, it works well.
    Thanks a lot.

     

Log in to post a comment.