Re: [GENERAL] JDBC +CIDR (fwd) - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: [GENERAL] JDBC +CIDR (fwd)
Date
Msg-id 41781FCC.3080902@opencloud.com
Whole thread Raw
In response to [GENERAL] JDBC +CIDR (fwd)  (Kris Jurka <books@ejurka.com>)
Responses Re: [GENERAL] JDBC +CIDR (fwd)  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Kris Jurka wrote:
> What kind of solution can we offer for this problem?  Do we really need to
> make PGobject extensions for every type?  Do we really want to force
> people to have to create these for all user defined types?

Well, you don't have to create a subclass, I think, if you don't mind
doing the parsing in the application:

  PGobject dummy = new PGobject();
  dummy.setType("cidr");
  dummy.setValue("192.168.0.0/24");
  statement.setObject(1, dummy, Types.OTHER);

Alternatively, does setString() + "?::cidr" work?

-O

pgsql-jdbc by date:

Previous
From: Christian Niles
Date:
Subject: Re: Calling functions with smallint fails
Next
From: Kris Jurka
Date:
Subject: Re: [GENERAL] JDBC +CIDR (fwd)