pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Lewis <mark.lewis@mir3.com>
To: Reuben Pasquini <pasquinir@bellsouth.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: CallableStatement.setTimestamp bug
Date: Wed, 15 Nov 2006 06:47:01 -0800
Message-ID: <1163602021.8021.0.camel@archimedes> (raw)
In-Reply-To: <EBBC2960-BEE4-4AB9-8567-2B68E8E50197@bellsouth.net>
References: <EBBC2960-BEE4-4AB9-8567-2B68E8E50197@bellsouth.net>

You don't happen to have another function called donothing which takes a
single parameter of a different type, do you?

-- Mark

On Tue, 2006-11-14 at 22:05 -0600, Reuben Pasquini wrote:
> Hello!
> 
> It appears that CallableStatement.setTimestamp()
> does not work correctly with the latest 8.1 jdbc driver -
> I've listed a test case below -
> sorry if this bug is already known.
> Let me know if you have any questions.
> Thanks for all the great work.
> 
> Reuben
> 
> --------------------
> 
> p-nut:/tmp pasquini$ javac Frick.java
> 
> p-nut:/tmp pasquini$ java -cp postgresql-8.1-407.jdbc3.jar:. Frick
> Nov 14, 2006 9:59:54 PM Frick main
> INFO: Caught: org.postgresql.util.PSQLException: ERROR: function  
> donothing("unknown") does not exist
> 
> 
> p-nut:/tmp pasquini$ cat Frick.java
> import java.util.*;
> import java.util.logging.Logger;
> import java.util.logging.Level;
> import java.lang.reflect.*;
> import java.sql.*;
> 
> /* .............
> CREATE OR REPLACE FUNCTION doNothing ( TIMESTAMP )
>    RETURNS INTEGER AS $FUNC$
>          BEGIN
>              RETURN 0;
>          END; $FUNC$
> LANGUAGE plpgsql;
> */
> 
> /**
> * Test postgres JDBC setTimestamp functionality against doNothing()
> */
> public class Frick {
> 
>      public static void main ( String[] v_argv ) {
>          Logger log_generic = Logger.getLogger ( "littleware" );
> 
>          try {
>              Class.forName ( "org.postgresql.Driver" );
>              Connection sql_conn = DriverManager.getConnection  
> ( "jdbc:postgresql:littleware://localhost:5432", "littleware_user",  
> "" );
>              CallableStatement sql_call = sql_conn.prepareCall ( "{ ?  
> = call doNothing ( ? ) }" );
>              java.util.Date  t_now = new java.util.Date ();
>              sql_call.registerOutParameter ( 1, Types.INTEGER );
>              sql_call.setTimestamp ( 2, new Timestamp ( t_now.getTime  
> () ) );
>              sql_call.execute ();
>          } catch ( Exception e ) {
>              log_generic.log ( Level.INFO, "Caught: " + e );
>          }
>      }
> }
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend



view thread (6+ messages)  latest in thread

Message-ID: <1163602021.8021.0.camel@archimedes>
Permalink:  ../1163602021.8021.0.camel@archimedes/
Also on:    postgresql.org/message-id/1163602021.8021.0.camel@archimedes

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mark.lewis@mir3.com, pasquinir@bellsouth.net
  Subject: Re: CallableStatement.setTimestamp bug
  In-Reply-To: <1163602021.8021.0.camel@archimedes>
  References: <EBBC2960-BEE4-4AB9-8567-2B68E8E50197@bellsouth.net> <1163602021.8021.0.camel@archimedes>

* 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