From: | "Patric Bechtel" <bechtel(at)ipcon(dot)de> |
---|---|
To: | "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: Error Code |
Date: | 2003-01-16 21:41:56 |
Message-ID: | 20030116214200.BCA094765F2@postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 16 Jan 2003 18:14:32 -0200, Daniel Serodio wrote:
You could alter (read: contribute) the JDBC driver with the possibility
of giving back the error-Strings which themselves are the way the
driver handles the messages before localizing them himself.
For example: the driver detects a "connection refused" error himself.
He now issues a
throw new PSQLException ("postgresql.con.refused");
Inside the PSQLException, this string is translated via some property
files in the /org/postgresql directory of the jar.
Inside this directory, there are some files named
"errors.properties", or "errors_de.properties" etc which have lines like
postgresql.con.refused:Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
or
postgresql.con.refused:Verbindung verweigert. Prüfen Sie, daß der Server TCP/IP-Verbindungen annimmt.
inside which is the error message of the driver.
It would be simple to patch PSQLException a bit to conserve the
error strings inside it and give them out to your "custom" translator, which
could make more "understandable" (for the non techie type of user)
error messages.
just my 0.02¬... :-)
Patric
>Not the driver's fault, the backend doesn't implement error codes. You
>should customize the error messages based on the exception's
>getMessage().
>[]'s
>Daniel Serodio
>On Thu, 2003-01-16 at 17:31, Isaías Cristiano Barroso wrote:
>> Hi All,
>>
>> Possible is get a error code when a SQLException occurr?
>> I utilize getErrorCode(), but this don't work, always return zero.
>> I need this to customize the error message for the users of my system.
>>
>> Driver JDBC : pg73jdbc3.jar
>>
>> Thanks
>>
>> Isaias
>--
>Daniel Serodio <daniel(at)checkforte(dot)com(dot)br>
>CheckForte
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
PGP Public Key Fingerprint: 2636 F26E F523 7D62 4377 D206 7C68 06BB
- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies.
mQGiBD4hkMERBADNMNrmye5hXtCU35gi5JB1IHkGuvgL/5BYkQpTyDLFA1rcHlUu
+lyCuQnaMBvqKXSbuwDymIOinbR/DFgRt7ZwWhlBZX9JCV2zcNbca2pJ9JFbrZ14
aTve0LWoO3ljZQz1g6dhC14D+a0vN3hDBvaxavgNeVIX5XJRKC02xlWhaQCg/0j0
S8/bNgKsbMSMVfAbeVrwGW0EALBiel6TNkKtO+8v2qMNvwR6AlGFPVgxX6B95xqC
RQlUDMKqd07Kfmub9qK7wX7n/c7ck96aSWsHkd+qXiX5wOrEUuVHUaR+OWQ772Gd
xzeJ1hgqEXNnUqwW8QnDGuKjJ3WwvbfULlyOVI2WnJKBJb9dMheiWFaloTOqJ5LU
y3feA/9i/Pd3QPgBOudu7QDNcWtqGAp4jLPOlzeCYFGZkRI0/yVGkdcZaqn4Ez1x
Aeb2y0ijSqDUJauTgE9RDNI4HZNPK7vFb7aN6WcZ8gNylQOZdS0h/uM1oisyv1YY
Q5I/pvjfT+iEwdMMPQVMh0DY0c4806BmAkFbh9samJaPpm6PYrQhUGF0cmljIEJl
Y2h0ZWwgPGJlY2h0ZWxAaXBjb24uZGU+iQBOBBARAgAOBQI+IZDBBAsDAgECGQEA
CgkQfGgGu8y7ypAN+ACeIbN5gD22P0QpCtufDGlDD1UIsoIAn19UJ5DhTWMwxeZf
KSBtjjVsswiiuQINBD4hkMEQCAD2Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4
INoBp1ajFOmPQFXz0AfGy0OplK33TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3b
zpnhV5JZzf24rnRPxfx2vIPFRzBhznzJZv8V+bv9kV7HAarTW56NoKVyOtQa8L9G
AFgr5fSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsYjY67
VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM
2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpMgs7AAICB/4+9hRIaZs+
MiJABA+QvbnU1N2SfrZ8PyhYk1FOAiLmSOPeT/6UWK7YEY6GiOujXRGpiqlyuAak
8YGDO0J5QURwZU1ao8toEXEpx5iHSo/pgf1m53IQIRaSDf05hzBBBbIjNMXCsjMk
FS2H2uozSNGdeBzTQqQ/tYnyodctbtc+bXaplKlbA85fj0JbbojBLv+S71E6j9fc
e0aqdNl5ZTy547dlZvXY/WgNJHBpmVVobStcOjYpYkF+0E8a9lTSoQHh4SXCjE/2
tf8W3TcPPVUgPeJzQGb2cdGgbC5I4Oaz6vDaAJ68hk3vKauoBcbjiISlUxqvul5M
tgb9kgcGDp9OiQBGBBgRAgAGBQI+IZDBAAoJEHxoBrvMu8qQly4Anjxp+O42ax91
dHIlZI93a3IYqjbZAJwJfDajIDVHHozMu8j5FEyV26WUEg==
=HZnf
- -----END PGP PUBLIC KEY BLOCK-----
PGP Public Key Fingerprint: 2636 F26E F523 7D62 4377 D206 7C68 06BB
-----BEGIN PGP SIGNATURE-----
Version: PGPsdk version 1.7.1 (C) 1997-1999 Network Associates, Inc. and its affiliated companies.
iQA/AwUBPicZFXxoBrvMu8qQEQJ4swCeIw+FCpK4MKI4paPsGtG+7pTmgvEAoLgA
Dry2WeVmKF7YpEtdfRKrMdk8
=jiaJ
-----END PGP SIGNATURE-----
From | Date | Subject | |
---|---|---|---|
Next Message | Campano, Troy | 2003-01-16 23:40:57 | Re: jdbc/redhat8.0/postgresql upgrade |
Previous Message | Tom Innes | 2003-01-16 20:41:59 | Re: Error Code |