Re: some improve JDBC

Поиск
Список
Период
Сортировка
От Víctor Pérez Juárez
Тема Re: some improve JDBC
Дата
Msg-id 200508041226.34792.victor.perez@e-evolution.com.mx
обсуждение исходный текст
Ответ на Re: some improve JDBC  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: some improve JDBC  (Oliver Jowett <oliver@opencloud.com>)
Список 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.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




В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Mahesh Shinde"
Дата:
Сообщение: Help needed
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: Help needed