What are all the possible values for SQLException.getSQLState?

前端 未结 4 1889
滥情空心
滥情空心 2021-02-05 09:14

SQLException.getSQLState retrieves the SQLState for the SQLException object. What are all the possible values that can be returned by this

4条回答
  •  青春惊慌失措
    2021-02-05 09:35

    Official documents that include SQLStates can obviously be purchased, at a relatively high price, from ANSI and XOpen. But, the documentation for most databases have lists of SQLStates. Probably the most complete ( and accessible ) online listings are in the DB2 manuals. Check the DB2 Universal Messages manual, for instance. Oracle ( TechNet password required ) and Sybase, among others, also have online listings.

    As to the second question, this is the intent of SQLState, however, the various databases have varying degrees of compliance. For example, some map multiple native error messages to the same SQLState. For generic use, one should probably concentrate on the major code ( the first two characters of SQLState, ) then determine if more specific info is available in the minor code ( beyond 000. )

    http://www.jguru.com/faq/view.jsp?EID=46397

提交回复
热议问题