pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
User Defined Types -- Using inet/cdr from JDBC ?
2+ messages / 2 participants
[nested] [flat]

* User Defined Types -- Using inet/cdr from JDBC ?
@ 2007-08-21 04:43 j.random.programmer <javadesigner@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: j.random.programmer @ 2007-08-21 04:43 UTC (permalink / raw)
  To: pgsql-jdbc

Hi all:

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

www.mollypages.org/dbo

Currently, this tool does not support any postgres
specific types. 
So, when doing the O/R mapping, if the JDBC Meta Data
returns:
  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
something 
like (in java):

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

The  program does not get too far. I get:

  Exception in thread "main"
org.postgresql.util.PSQLException: 
    Method 
org.postgresql.jdbc3.Jdbc3ResultSet.getObjectImpl(int,Map)
     is not yet implemented.

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

Best regards,
--j 




       
____________________________________________________________________________________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: User Defined Types -- Using inet/cdr from JDBC ?
@ 2007-08-23 12:24 rfrancis@ev.net
  0 siblings, 0 replies; 2+ messages in thread

From: rfrancis@ev.net @ 2007-08-23 12:24 UTC (permalink / raw)
  To: j.random.programmer <javadesigner@yahoo.com>; +Cc: pgsql-jdbc

J. Random,

I have implemented network datatype extensions for the JDBC driver.  This includes PGcidr, PGinet and PGmacaddr, they are available from the following URL.

http://oak.cats.ohiou.edu/~rf358197/jdbc/2/

They should be pretty easy to use and if you find any defects I am more than happy to fix them.  I would love to see them integrated into the base driver at some point  and am willing to make any modifications which need to be made to facilitate this.     Hopefully they will be of some use to you.

Kind Regards,
Russell Francis



-----Original Message-----
From: "j.random.programmer" <javadesigner@yahoo.com>
Sent: Tue, August 21, 2007 12:43 am
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] User Defined Types -- Using inet/cdr from JDBC ?

Hi all:

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

www.mollypages.org/dbo

Currently, this tool does not support any postgres
specific types. 
So, when doing the O/R mapping, if the JDBC Meta Data
returns:
  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
something 
like (in java):

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

The  program does not get too far. I get:

  Exception in thread "main"
org.postgresql.util.PSQLException: 
    Method 
org.postgresql.jdbc3.Jdbc3ResultSet.getObjectImpl(int,Map)
     is not yet implemented.

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

Best regards,
--j 




       
____________________________________________________________________________________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2007-08-23 12:24 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-08-21 04:43 User Defined Types -- Using inet/cdr from JDBC ? j.random.programmer <javadesigner@yahoo.com>
2007-08-23 12:24 Re: User Defined Types -- Using inet/cdr from JDBC ? rfrancis@ev.net

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox