Re: JDBC Emit SQLError code for communication errors

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Barry Lind <blind(at)xythos(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: JDBC Emit SQLError code for communication errors
Date: 2002-11-20 18:11:00
Message-ID: 3DDBD034.2020004@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Barry, please find attached the patch including the change to getSqlStateType()
as you requested. I knew I had to change it but I end up forgetting. Sorry.

See other comments below.

Barry Lind wrote:> Fernando,
>
> I have a couple of questions about this patch.
>
> 1) Where did you get the sql state value you are using here? According
> to the jdbc3 docs the value can either be the XOPEN value or the SQL99
> value. (For jdbc1 and jdbc2 the value must be the XOPEN value).

It is the X/Open one. If we were to issue SQL99 (for JDBC3) I would have to
make extensive changes so that PSQLException would work different depending if
it is a JDBC1/2 or JDBC3.

Also, there is a basic flaw in the getSqlStateType() approach. If my
application is not certain that it is a JDBC3 driver it can't use it. And I
believe there is no way to check what level of JDBC you have either. Is that
correct?

Anyway, if the backend eventually sends us SQL99 codes for the SQLExceptions we
do not interpret, we can convert to equivalent X/Open codes.

> Also
> could you provide me a link to someplace so that I can read more about
> the possible values?
>

It is the X/Open standard document. Unfortunately it is not available online
and you have to pay USD43 to download. See www.opengroup.org

> 2) This patch should also include changes to DatabaseMetaData to
> correctly report the answer to the above question in getSqlStateType()
>

Done.

Thanks for the comments and for catching the getSqlStateType() omission.

Regards,
Fernando

--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

Attachment Content-Type Size
JDBCSQLSTATUS.PATCH text/plain 7.0 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-11-20 18:20:21 documentation for reserved_superuser_connections
Previous Message Barry Lind 2002-11-20 01:37:46 Re: JDBC Emit SQLError code for communication errors