pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: elias.ross@software.com
Cc: PostgreSQL-interfaces <pgsql-interfaces@postgresql.org>
Subject: Re: Simple bug in JDBC interface
Date: Fri, 2 Jun 2000 21:40:55 -0400 (EDT)
Message-ID: <200006030140.VAA09587@candle.pha.pa.us> (raw)
In-Reply-To: <39382A29.ABD8A3DB@software.com>

Peter, can you please comment on this?


> 
> Sorry if I'm e-mailing the wrong person.
> 
> This is to do with loading "exotic types" through JDBC.
> 
> It has to do with how it tries to load the class: (perhaps under old
> hierarchy?)
> 	postgresql.geometric.PGpoint
> when in fact it SHOULD be loading
> 	ORG.postgresql.geometric.PGpoint
>  	^^^
> 
> ///// EXAMPLE:
> 
> import java.io.*;
> import java.sql.*;
> 
> /* 
> This error:
> 
> Failed to create object for point java.lang.ClassNotFoundException:
> postgresql.geometric.PGpoint
>         at java.lang.Throwable.fillInStackTrace(Native Method)
>         at java.lang.Throwable.<init>(Throwable.java:82)
>         at java.lang.Exception.<init>(Exception.java:33)
>         at java.sql.SQLException.<init>(SQLException.java:98)
>         at
> org.postgresql.util.PSQLException.<init>(PSQLException.java:53)
>         at org.postgresql.Connection.getObject(Connection.java:624)
>         at org.postgresql.jdbc2.ResultSet.getObject(ResultSet.java:741)
>         at PostgresTest.<init>(PostgresTest.java:23)
>         at PostgresTest.main(PostgresTest.java:31)
> 
> 
> in psql:
> 
> testdb=# \d users
>  minid     | char(15) |
>  status    | char(3)  |
>  location  | point    |
> */
> 
> public class PostgresTest {
> 
>         public PostgresTest() 
>                 throws Exception
>         {
>                 Class.forName("org.postgresql.Driver");
>                 Connection c =
> DriverManager.getConnection("jdbc:postgresql://beryl:5432/testdb",
> "postgres", "");
>                 Statement s = c.createStatement();
>                 BufferedReader r = new BufferedReader(new
> InputStreamReader(System.in));        
>                 // while (true) {
>                         // System.out.print("Enter query: ");
>                         // System.out.flush();
>                         String query;
>                         //query = r.readLine();
>                         query = "select * from users";
>                         ResultSet res = s.executeQuery(query);
>                         if (res != null) {
>                                 while (res.next()) {
>                                         System.out.println("" +
> res.getString(1) + " " + res.getString(2) + " " + res.getObject(3));
>                                 }
>                         }
>                 //}
>         }
> 
>         public static void main(String args[]) {
>                 try {
>                         PostgresTest pt = new PostgresTest();
>                 } catch (Exception e) {
>                         e.printStackTrace();
>                 }
>         }
> 
> }
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



view thread (3+ messages)  latest in thread

Message-ID: <200006030140.VAA09587@candle.pha.pa.us>
Permalink:  ../200006030140.VAA09587@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200006030140.VAA09587@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: pgman@candle.pha.pa.us, elias.ross@software.com
  Subject: Re: Simple bug in JDBC interface
  In-Reply-To: <200006030140.VAA09587@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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