Re: SQLException subclasses

Поиск
Список
Период
Сортировка
От Joe Shevland
Тема Re: SQLException subclasses
Дата
Msg-id HEECIHEEJDBMCCGMGIOBAEJGCFAA.jshevland@j-elite.com
обсуждение исходный текст
Ответ на SQLException subclasses  (TimothyReaves@westfieldgrp.com)
Список pgsql-jdbc
There is work in progress (I think) to have the backend generate integer
error codes based on different occurences; once this occurs the error
numbers are going to be propogated through to the front-end (JDBC driver)
where we will be able to say SQLException.getErrorCode() and perform
different actions for different problems.

ATM, though, I think you're stuck with parsing the messages you get back
:( I have done this for an internal app in a few cases, and it works, but
it very likely to break at some stage (l10n of error messages etc).

Regards,
Joe

>      Has any thought been given to subclassing SQLException to better
> control what happens when an exception occurs?  There is a difference
> between how I would like to handle different things.  Particularly pk
> exceptions.  I'm sure I could parse the text of the exception, but would
a
> DuplicatePrimaryKeyException be better than the generic SQLException?

Вложения

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Joe Shevland"
Дата:
Сообщение: Re: PostgreSQL+PHP+JDBC+Java Smart Card
Следующее
От: Cosmin Coroiu
Дата:
Сообщение: Duplicate key identification