Better error messages from JDBC

From: "Reuven M(dot) Lerner" <reuven(at)lerner(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: Better error messages from JDBC
Date: 2000-07-30 14:26:38
Message-ID: 14724.15134.386365.578715@martin-buber.lerner.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, folks. I've been using PostgreSQL over the last six months or so
(after a bitter experience 2-3 years ago), and have been
overwhelmingly pleased with what I see. Good job, all you core
developers!

My question is whether I can get better error messages from JDBC than
the text of an SQLException. I know that if something goes wrong
during a transaction, the SQLException will be thrown, and I can get
lots of interesting information out of that. But it would be nice to
be able to produce a beautifully formatted error message for the user,
and to catch certain errors, rather than simply pass text to the user.

(For example, if a given column has a "CHECK colname <> ''", I would
like to be able to tell the user that a column shouldn't be left
blank. I could obviously check this at the application level as well,
and that's what I expect to end up doing -- but I wouldn't mind
getting a bit of help from the database.

Also: Perl provides a (slow, but cool) means to retrieve a row as a
hash, in which the keys are the column names and the values are the
actual column values. Is there any such function for the PostgreSQL
JDBC driver, perhaps using Hashtables? Is there any method for
retrieving lots of rows at once, rather than one by one?

Thanks for any advice you can offer!

Reuven

Browse pgsql-general by date

  From Date Subject
Next Message dave 2000-07-30 19:12:51 Re: [PHP-INST] problem compiling php for pgsql
Previous Message Jan Wieck 2000-07-30 11:48:04 Re: Inheritance