Обсуждение: Use of bytea

Поиск
Список
Период
Сортировка

Use of bytea

От
"Chris White (cjwhite)"
Дата:
Is it possible in jdbc to use a bytea column in a where clause and compare it to byte[] object?
 
Chris White

Re: Use of bytea

От
Oliver Jowett
Дата:
Chris White (cjwhite) wrote:
> Is it possible in jdbc to use a bytea column in a where clause and
> compare it to byte[] object?

Yes.

-O

Re: Use of bytea

От
"Chris White (cjwhite)"
Дата:
How? Can you give me an example.

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Oliver Jowett
Sent: Sunday, December 05, 2004 5:23 AM
To: cjwhite@cisco.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Use of bytea

Chris White (cjwhite) wrote:
> Is it possible in jdbc to use a bytea column in a where clause and
> compare it to byte[] object?

Yes.

-O

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


Re: Use of bytea

От
"Chris White (cjwhite)"
Дата:
Do not worry just realized how to do it using PreparedStatement.

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Chris White (cjwhite)
Sent: Sunday, December 05, 2004 11:24 AM
To: 'Oliver Jowett'
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Use of bytea

How? Can you give me an example.

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Oliver Jowett
Sent: Sunday, December 05, 2004 5:23 AM
To: cjwhite@cisco.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Use of bytea

Chris White (cjwhite) wrote:
> Is it possible in jdbc to use a bytea column in a where clause and
> compare it to byte[] object?

Yes.

-O

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@postgresql.org so that your
      message can get through to the mailing list cleanly


Re: Use of bytea

От
Oliver Jowett
Дата:
Chris White (cjwhite) wrote:
> Do not worry just realized how to do it using PreparedStatement.

Ah, sorry, I thought you were just asking if the driver would handle it.
Yeah, just use PreparedStatement.setBytes(). We use bytea values in
where clauses in this way with no problems.

-O