Re: some improve JDBC

From: Víctor Pérez Juárez <victor(dot)perez(at)e-evolution(dot)com(dot)mx>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: Oliver Jowett <oliver(at)opencloud(dot)com>
Subject: Re: some improve JDBC
Date: 2005-08-04 17:26:34
Message-ID: 200508041226.34792.victor.perez@e-evolution.com.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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(dot)perez(at)e-evolution(dot)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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2005-08-04 20:02:17 Re: Help needed
Previous Message Christian Franzke 2005-08-04 16:13:59 UNSUBSCRIBE