pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: Simple bug in JDBC interface
3+ messages / 3 participants
[nested] [flat]

* Re: Simple bug in JDBC interface
@ 2000-06-03 01:40 Bruce Momjian <pgman@candle.pha.pa.us>
  2000-06-05 10:31 ` Re: Re: Simple bug in JDBC interface Peter Mount <peter@retep.org.uk>
  0 siblings, 1 reply; 3+ messages in thread

From: Bruce Momjian @ 2000-06-03 01:40 UTC (permalink / raw)
  To: elias.ross@software.com; +Cc: pgsql-interfaces

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



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

* Re: Re: Simple bug in JDBC interface
  2000-06-03 01:40 Re: Simple bug in JDBC interface Bruce Momjian <pgman@candle.pha.pa.us>
@ 2000-06-05 10:31 ` Peter Mount <peter@retep.org.uk>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Mount @ 2000-06-05 10:31 UTC (permalink / raw)
  To: Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-interfaces

On Fri, 2 Jun 2000, Bruce Momjian wrote:

> Peter, can you please comment on this?

I'll check. It may be that org. is being missed off somewhere (although
when I did a grep to check that all references to postgresql were prefixed
with org. I didn't find any).

PS: On another subject, I've found the errant DataSource class, but I'm
having problems with cvs (postgresql.org doesn't like my password).

I'll check on this as soon as I get cvs working.

Peter

> > 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
> 

--
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




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

* RE: Re: Simple bug in JDBC interface
@ 2000-06-06 07:45 Peter Mount <petermount@it.maidstone.gov.uk>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Mount @ 2000-06-06 07:45 UTC (permalink / raw)
  To: 'Bruce Momjian' <pgman@candle.pha.pa.us>; elias.ross@software.com; +Cc: pgsql-interfaces

Found and fixed them.

I gave up trying to get a fresh cvs copy yesterday after 6 hours. Did it
from work this morning and it took about 10 minutes!

Any how, it's done.

peter

--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council

> -----Original Message-----
> From:	Bruce Momjian [SMTP:pgman@candle.pha.pa.us]
> Sent:	Saturday, June 03, 2000 2:41 AM
> To:	elias.ross@software.com
> Cc:	PostgreSQL-interfaces
> Subject:	[INTERFACES] Re: Simple bug in JDBC interface
> 
> 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



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


end of thread, other threads:[~2000-06-06 07:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-06-03 01:40 Re: Simple bug in JDBC interface Bruce Momjian <pgman@candle.pha.pa.us>
2000-06-05 10:31 ` Peter Mount <peter@retep.org.uk>
2000-06-06 07:45 RE: Re: Simple bug in JDBC interface Peter Mount <petermount@it.maidstone.gov.uk>

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