| From: | "Sean Duffy" <sean(dot)duffy(at)programmer(dot)net> |
|---|---|
| To: | "Dave Cramer" <Dave(at)micro-automation(dot)net>, "'Sean Duffy'" <sean(dot)duffy(at)programmer(dot)net>, <pgsql-jdbc(at)postgresql(dot)org> |
| Subject: | Re: Handling null values in char fields from JDBC |
| Date: | 2002-01-22 18:37:21 |
| Message-ID: | 20020122183723.41997.qmail@mail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
-----Original Message-----
From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
Date: Tue, 22 Jan 2002 10:03:06 -0500
To: "'Sean Duffy'" <sean(dot)duffy(at)programmer(dot)net>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [JDBC] Handling null values in char fields from JDBC
Dave -
Yes when the field is added as a char field
it contains all null values. I currently go
in with psql and set the null values to ''
but would like to handle the situation a
little more elegantly.
Thanks for getting back to me :)
Sean
> Sean,
>
> Just to clarify? Is there a null in the data on the server?
>
> Dave
>
> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Sean Duffy
> Sent: Tuesday, January 22, 2002 9:22 AM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: [JDBC] Handling null values in char fields from JDBC
>
>
>
> I am running Postgresql 7.1.3 and using the 7.1-1.2 jar jdbc driver. I
> noticed that when I used a ResultSet.getString("charfield") call to
> fetch null data from the char field I get a null pointer exception
> error. My question is two fold..
> 1) Is this normal behavior for the jdbc driver?
> 2) Is there a recommended way of trapping for a null value in a char
> field (besides just going into the db with psql and setting all null
> values to '')?
>
> I have looked thru two different Postgresql manuals but have not been
> able to find anything referring to null value handling at the jdbc
> level.
>
> If anyone can pt me in the right direction I
> would really appreciate it.
>
> Thanks!
> --
>
> _______________________________________________
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
>
> 1 cent a minute calls anywhere in the U.S.!
>
> http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=htt
> p://www.getpennytalk.com
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
--
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
1 cent a minute calls anywhere in the U.S.!
http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tony DeWitt | 2002-01-22 18:42:48 | JDBC batching |
| Previous Message | Sean Duffy | 2002-01-22 18:34:18 | Re: Handling null values in char fields from JDBC |