pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Víctor Pérez Juárez <victor.perez@e-evolution.com.mx>
To: pgsql-jdbc@postgresql.org
Cc: Oliver Jowett <oliver@opencloud.com>
Subject: Re: some improve JDBC
Date: Thu, 4 Aug 2005 12:26:34 -0500
Message-ID: <200508041226.34792.victor.perez@e-evolution.com.mx> (raw)
In-Reply-To: <42F15E85.5060603@opencloud.com>
References: <200508021235.03510.victor.perez@e-evolution.com.mx>
	<200508031220.16657.victor.perez@e-evolution.com.mx>
	<42F15E85.5060603@opencloud.com>

Hi Oliver!

The problem is that RowSet launchs an exception when JDBC return -1 this cause 
my Aplicaction does not work the reasons are down.

The source code in package javax.sql.rowset.RowSetMetaDataImpl.java

/**
     * Sets the normal maximum number of chars in the designated column
     * to the given number.
     *
     * @param columnIndex the first column is 1, the second is 2, and so on;
     *        must be between <code>1</code> and the number of columns, 
inclusive
     * @param size the maximum size of the column in chars; must be
     *        <code>0</code> or more
     * @throws SQLException if a database access error occurs,
     *        the given column number is out of bounds, or <i>size</i> is
     *        less than <code>0</code>
     */
    public void setColumnDisplaySize(int columnIndex, int size) throws 
SQLException {
        if (size < 0) {
            throw new SQLException("Invalid column display size. Cannot be 
less " +
                "than zero");
        }
        checkColRange(columnIndex);
        colInfo[columnIndex].columnDisplaySize = size;
    }

the same case is for setPrecision,setScale

Cheers
-- 
Víctor Pérez Juárez
CEO
e-Evolution,S.C. 
www.e-evolution.com
victor.perez@e-evolution.com
teléfono: (52)7711070937
   skype: vpj-cd

El Miércoles, 3 de Agosto de 2005 19:17, Oliver Jowett escribió:
> Víctor Pérez Juárez wrote:
> > Of cosure!
> >
> > my changes are commnet with e-evolution
>
> [...]
>
> In the future, please supply a proper diff ('cvs diff -c' will do the
> trick if you are working from CVS). It's very hard to see the changes
> you've made otherwise.
>
> It appears to boil down to "return 0 instead of -1 for column display
> size when we don't know the actual length"?
>


> Why is 0 better than -1 in this case? I don't see anything in the JDBC
> spec that covers this..
>
> -O
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org






view thread (7+ messages)  latest in thread

Message-ID: <200508041226.34792.victor.perez@e-evolution.com.mx>
Permalink:  ../200508041226.34792.victor.perez@e-evolution.com.mx/
Also on:    postgresql.org/message-id/200508041226.34792.victor.perez@e-evolution.com.mx

 · 

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: victor.perez@e-evolution.com.mx, oliver@opencloud.com
  Subject: Re: some improve JDBC
  In-Reply-To: <200508041226.34792.victor.perez@e-evolution.com.mx>
  References: <200508021235.03510.victor.perez@e-evolution.com.mx> <200508031220.16657.victor.perez@e-evolution.com.mx> <42F15E85.5060603@opencloud.com> <200508041226.34792.victor.perez@e-evolution.com.mx>

* 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