Skip site navigation (1) Skip section navigation (2)

User Defined Types -- Using inet/cdr from JDBC ?

From: "j(dot)random(dot)programmer" <javadesigner(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: User Defined Types -- Using inet/cdr from JDBC ?
Date: 2007-08-21 04:43:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Hi all:

I have recently released my O/R mapping tool (molly)

Currently, this tool does not support any postgres
specific types. 
So, when doing the O/R mapping, if the JDBC Meta Data
  java.sql.Types.OTHER (1111), 
the O/R tool gives up and says:
Exception in thread "main" java.sql.SQLException: This
framework does not understand/support columns of this
type. [java.sql.Type: 1111]

Ok so far, so good (or bad). But now I do have a need
to use:

1) inet, cdr types
2) point, circle etc types

Suppose, I have:

  create table test (my_ip_address  inet);

Looking over the JDBC docs, I see that I may to say
like (in java):

1	ResultSet rs = stmt.executeQuery("select * from
2	Map map = new HashMap();
3	map.put("inet", foo.class);  //string -> user
defined class
5	Object o = rs.getObject(1, map);						

The  program does not get too far. I get:

  Exception in thread "main"
     is not yet implemented.

Any comments on the current/future ability to use
types in this way ? I'm guessing I can instead use
PGpoint etc., but
what about inet/cdr ?

Best regards,

____________________________________________________________________________________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV.

pgsql-jdbc by date

Next:From: David GoodenoughDate: 2007-08-21 14:06:20
Subject: Support for ResultSetMetaData.getTableName
Previous:From: ttvvaaDate: 2007-08-20 14:18:29
Subject: JDBC COPY error encoding

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group