pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgres and Jdbc 2.0
6+ messages / 4 participants
[nested] [flat]

* postgres and Jdbc 2.0
@ 2004-08-04 14:20 chinni <naveen.bysani@gmail.com>
  2004-08-04 14:43 ` Re: postgres and Jdbc 2.0 Dave Cramer <pg@fastcrypt.com>
  2004-08-04 18:47 ` Re: postgres and Jdbc 2.0 Kris Jurka <books@ejurka.com>
  2004-08-04 22:38 ` Re: [HACKERS] postgres and Jdbc 2.0 Oliver Jowett <oliver@opencloud.com>
  0 siblings, 3 replies; 6+ messages in thread

From: chinni @ 2004-08-04 14:20 UTC (permalink / raw)
  To: pgsql-hackers@postgresql.org

Hi All!
Please note that the following functions are not implemented in the 
postgres driver
even though they are a part of the JDBC 2.0 standard.

Some of these may be party implemented, but may not be complete.

<differences>
Blob.java
    public long position(byte[] pattern, long start) throws SQLException

Clob.java
    public long position(String pattern, long start) throws SQLException
    public long position(Clob pattern, long start) throws SQLException

Connection.java
    public Object getObject(String type, String value) throws SQLException

DatabaseMetaData.java
    public java.sql.ResultSet getUDTs(String catalog,String 
schemaPattern,String typeNamePattern,int[] types) throws SQLException

ResultSet.java
    public Object getObject(int i, java.util.Map map) throws SQLException
    public Ref getRef(int i) throws SQLException
    public void setFetchDirection(int direction) throws SQLException
    public boolean rowDeleted() throws SQLException
    public boolean rowInserted() throws SQLException
    public boolean rowUpdated() throws SQLException
   
Statement.java
    public int getFetchDirection() throws SQLException
    public void setFetchDirection(int direction) throws SQLException
    public void setRef(int i, Ref x) throws SQLException
    public Blob getBlob(int i) throws SQLException
    public Clob getClob(int i) throws SQLException
    public Object getObject(int i, java.util.Map map) throws SQLException
    public Ref getRef(int i) throws SQLException
    public java.sql.Date getDate(int i, java.util.Calendar cal) throws 
SQLException
    public Time getTime(int i, java.util.Calendar cal) throws SQLException
    public Timestamp getTimestamp(int i, java.util.Calendar cal) throws 
SQLException
    public void registerOutParameter(int parameterIndex, int sqlType, 
String typeName) throws SQLException
    public java.sql.Array getArray(int i) throws SQLException

Array.java
    public Object getArray(long index, int count, Map map) throws 
SQLException
    public java.sql.ResultSet getResultSet(long index, int count, 
java.util.Map map) throws SQLException

</differences>

There are a few things which I want to know.

1) Is there anything more which I am missing wrt JDBC 2.0 and postgres.

2)  If I want to add these features to JDBC driver, is there anything
that has to go to                          database itself.


thanks
naveen

                                                            
-- 
"Stand for something, or you will fall for nothing."



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

* Re: postgres and Jdbc 2.0
  2004-08-04 14:20 postgres and Jdbc 2.0 chinni <naveen.bysani@gmail.com>
@ 2004-08-04 14:43 ` Dave Cramer <pg@fastcrypt.com>
  2 siblings, 0 replies; 6+ messages in thread

From: Dave Cramer @ 2004-08-04 14:43 UTC (permalink / raw)
  To: chinni <naveen.bysani@gmail.com>; +Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>

First, there is a list for the jdbc driver.

Second, which version are you using?

I know some of these are implemented already.

getUDT's, setFetchDirection, gettime, ...

Dave
On Wed, 2004-08-04 at 10:20, chinni wrote:
> Hi All!
> Please note that the following functions are not implemented in the 
> postgres driver
> even though they are a part of the JDBC 2.0 standard.
> 
> Some of these may be party implemented, but may not be complete.
> 
> <differences>
> Blob.java
>     public long position(byte[] pattern, long start) throws SQLException
> 
> Clob.java
>     public long position(String pattern, long start) throws SQLException
>     public long position(Clob pattern, long start) throws SQLException
> 
> Connection.java
>     public Object getObject(String type, String value) throws SQLException
> 
> DatabaseMetaData.java
>     public java.sql.ResultSet getUDTs(String catalog,String 
> schemaPattern,String typeNamePattern,int[] types) throws SQLException
> 
> ResultSet.java
>     public Object getObject(int i, java.util.Map map) throws SQLException
>     public Ref getRef(int i) throws SQLException
>     public void setFetchDirection(int direction) throws SQLException
>     public boolean rowDeleted() throws SQLException
>     public boolean rowInserted() throws SQLException
>     public boolean rowUpdated() throws SQLException
>    
> Statement.java
>     public int getFetchDirection() throws SQLException
>     public void setFetchDirection(int direction) throws SQLException
>     public void setRef(int i, Ref x) throws SQLException
>     public Blob getBlob(int i) throws SQLException
>     public Clob getClob(int i) throws SQLException
>     public Object getObject(int i, java.util.Map map) throws SQLException
>     public Ref getRef(int i) throws SQLException
>     public java.sql.Date getDate(int i, java.util.Calendar cal) throws 
> SQLException
>     public Time getTime(int i, java.util.Calendar cal) throws SQLException
>     public Timestamp getTimestamp(int i, java.util.Calendar cal) throws 
> SQLException
>     public void registerOutParameter(int parameterIndex, int sqlType, 
> String typeName) throws SQLException
>     public java.sql.Array getArray(int i) throws SQLException
> 
> Array.java
>     public Object getArray(long index, int count, Map map) throws 
> SQLException
>     public java.sql.ResultSet getResultSet(long index, int count, 
> java.util.Map map) throws SQLException
> 
> </differences>
> 
> There are a few things which I want to know.
> 
> 1) Is there anything more which I am missing wrt JDBC 2.0 and postgres.
> 
> 2)  If I want to add these features to JDBC driver, is there anything
> that has to go to                          database itself.
> 
> 
> thanks
> naveen
> 
>                                                             
-- 
Dave Cramer
519 939 0336
ICQ # 14675561




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

* Re: postgres and Jdbc 2.0
  2004-08-04 14:20 postgres and Jdbc 2.0 chinni <naveen.bysani@gmail.com>
@ 2004-08-04 18:47 ` Kris Jurka <books@ejurka.com>
  2 siblings, 0 replies; 6+ messages in thread

From: Kris Jurka @ 2004-08-04 18:47 UTC (permalink / raw)
  To: chinni <naveen.bysani@gmail.com>; +Cc: pgsql-hackers@postgresql.org



> 2)  If I want to add these features to JDBC driver, is there anything
> that has to go to                          database itself.
> 

Generally JDBC questions are best discussed on the 
pgsql-jdbc@postgresql.org list.  First make sure you are working with the 
latest source code available from 
http://gborg.postgresql.org/project/pgjdbc/projdisplay.php which as 
Dave mentioned has implemented some of these methods already.  As to 
whether anything needs to be added to the server, that depends on your 
implementation.  The Blob/Clob positioning seems like it could be done 
more efficiently on the server side.  Also the server doesn't have a Ref 
datatype, so you really can't implement get/setRef without it.

Kris Jurka



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

* Re: [HACKERS] postgres and Jdbc 2.0
  2004-08-04 14:20 postgres and Jdbc 2.0 chinni <naveen.bysani@gmail.com>
@ 2004-08-04 22:38 ` Oliver Jowett <oliver@opencloud.com>
  2004-08-04 22:49   ` Re: [HACKERS] postgres and Jdbc 2.0 Oliver Jowett <oliver@opencloud.com>
  2 siblings, 1 reply; 6+ messages in thread

From: Oliver Jowett @ 2004-08-04 22:38 UTC (permalink / raw)
  To: chinni <naveen.bysani@gmail.com>; +Cc: pgsql-jdbc

(moved to pgsql-jdbc)

chinni wrote:
> Hi All!
> Please note that the following functions are not implemented in the 
> postgres driver
> even though they are a part of the JDBC 2.0 standard.
> 
> Some of these may be party implemented, but may not be complete.

Check a current driver from jdbc.postgresql.org.

>     public void setFetchDirection(int direction) throws SQLException

Implemented already.

>     public boolean rowDeleted() throws SQLException
>     public boolean rowInserted() throws SQLException
>     public boolean rowUpdated() throws SQLException

Implemented already; you may not like the fact they always return false, 
but this is accurate and consistent with what the database metadata 
claims. The server does not provide a way to implement these in any 
other way.

> Statement.java
>     public int getFetchDirection() throws SQLException
>     public void setFetchDirection(int direction) throws SQLException

Both implemented already.

>     public void registerOutParameter(int parameterIndex, int sqlType, 
> String typeName) throws SQLException

The underlying server does not support out parameters. This is also why 
the getXXX accessors on CallableStatement are not implemented.

> Array.java
>     public Object getArray(long index, int count, Map map) throws 
> SQLException
>     public java.sql.ResultSet getResultSet(long index, int count, 
> java.util.Map map) throws SQLException

How are you obtaining the Array implementation? It's an interface.

> There are a few things which I want to know.
> 
> 1) Is there anything more which I am missing wrt JDBC 2.0 and postgres.

You need to test a more recent driver.

Many of the features you see as missing are actually just unsupported by 
the underlying server -- it's not something you can fix in the driver. I 
don't think that JDBC2 *requires* support for many of these features so 
long as the database metadata is accurate about what it claims to support.

The fetch direction is a hint only -- you can't expect particular 
behaviour. There are improvements to cursor support that could be done, 
but they won't change the client-visible behaviour.

> 2)  If I want to add these features to JDBC driver, is there anything
> that has to go to                          database itself.

I don't understand the question.

-O



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

* Re: [HACKERS] postgres and Jdbc 2.0
  2004-08-04 14:20 postgres and Jdbc 2.0 chinni <naveen.bysani@gmail.com>
  2004-08-04 22:38 ` Re: [HACKERS] postgres and Jdbc 2.0 Oliver Jowett <oliver@opencloud.com>
@ 2004-08-04 22:49   ` Oliver Jowett <oliver@opencloud.com>
  2004-08-05 01:22     ` Re: [HACKERS] postgres and Jdbc 2.0 Dave Cramer <pg@fastcrypt.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Oliver Jowett @ 2004-08-04 22:49 UTC (permalink / raw)
  To: chinni <naveen.bysani@gmail.com>; +Cc: pgsql-jdbc

Oliver Jowett wrote:

>>     public void registerOutParameter(int parameterIndex, int sqlType, 
>> String typeName) throws SQLException
> 
> 
> The underlying server does not support out parameters. This is also why 
> the getXXX accessors on CallableStatement are not implemented.

Sorry -- misinterpreted this one.

You can't have arbitary out parameters. You can have a single out return 
parameter for a function call. I assumed you were trying for arbitary 
out parameters.

The registerOutParameter() variant that takes a UDT typename is not 
implemented as the driver does not support UDTs.

There's no obvious reason why the unimplemented getXXX() methods are 
unimplemented (those that are implemented on ResultSet, at least)

-O



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

* Re: [HACKERS] postgres and Jdbc 2.0
  2004-08-04 14:20 postgres and Jdbc 2.0 chinni <naveen.bysani@gmail.com>
  2004-08-04 22:38 ` Re: [HACKERS] postgres and Jdbc 2.0 Oliver Jowett <oliver@opencloud.com>
  2004-08-04 22:49   ` Re: [HACKERS] postgres and Jdbc 2.0 Oliver Jowett <oliver@opencloud.com>
@ 2004-08-05 01:22     ` Dave Cramer <pg@fastcrypt.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Dave Cramer @ 2004-08-05 01:22 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: chinni <naveen.bysani@gmail.com>; pgsql-jdbc


On Wed, 2004-08-04 at 18:49, Oliver Jowett wrote:
> Oliver Jowett wrote:
> 
> >>     public void registerOutParameter(int parameterIndex, int sqlType, 
> >> String typeName) throws SQLException
> >
this will be implemented shortly, but it will rely on a specific
function mechanism.

--dc--
>  
> > 
> > The underlying server does not support out parameters. This is also why 
> > the getXXX accessors on CallableStatement are not implemented.
> 
> Sorry -- misinterpreted this one.
> 
> You can't have arbitary out parameters. You can have a single out return 
> parameter for a function call. I assumed you were trying for arbitary 
> out parameters.
> 
> The registerOutParameter() variant that takes a UDT typename is not 
> implemented as the driver does not support UDTs.
> 
> There's no obvious reason why the unimplemented getXXX() methods are 
> unimplemented (those that are implemented on ResultSet, at least)
> 
> -O
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
> 
-- 
Dave Cramer
519 939 0336
ICQ # 14675561




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


end of thread, other threads:[~2004-08-05 01:22 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-08-04 14:20 postgres and Jdbc 2.0 chinni <naveen.bysani@gmail.com>
2004-08-04 14:43 ` Dave Cramer <pg@fastcrypt.com>
2004-08-04 18:47 ` Kris Jurka <books@ejurka.com>
2004-08-04 22:38 ` Oliver Jowett <oliver@opencloud.com>
2004-08-04 22:49   ` Oliver Jowett <oliver@opencloud.com>
2004-08-05 01:22     ` Dave Cramer <pg@fastcrypt.com>

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