Thread: setMaxFieldSize

setMaxFieldSize

From
Fernando Nasser
Date:
Can you someone tell me why we do not implement this?  The comment does
not explain why the "NOT!".

All we have to do is to properly truncate the received values. If this
is a good programming practice or not it is debatable, but it is in the
JDBC standard anyway.  It may even be useful for some applications out
there.


    /*
     * Sets the maxFieldSize - NOT! - We throw an SQLException just
     * to inform them to stop doing this.
     *
     * @param max the new max column size limit; zero means unlimited
     * @exception SQLException if a database access error occurs
     */
    public void setMaxFieldSize(int max) throws SQLException
    {
        throw new PSQLException("postgresql.stat.maxfieldsize");
    }

--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Re: setMaxFieldSize

From
Barry Lind
Date:
Fernando,

No reason that I can think of.  That code predates my involvement.

thanks,
--Barry

Fernando Nasser wrote:
> Can you someone tell me why we do not implement this?  The comment does
> not explain why the "NOT!".
>
> All we have to do is to properly truncate the received values. If this
> is a good programming practice or not it is debatable, but it is in the
> JDBC standard anyway.  It may even be useful for some applications out
> there.
>
>
>     /*
>      * Sets the maxFieldSize - NOT! - We throw an SQLException just
>      * to inform them to stop doing this.
>      *
>      * @param max the new max column size limit; zero means unlimited
>      * @exception SQLException if a database access error occurs
>      */
>     public void setMaxFieldSize(int max) throws SQLException
>     {
>         throw new PSQLException("postgresql.stat.maxfieldsize");
>     }
>




Re: setMaxFieldSize

From
Fernando Nasser
Date:
Barry Lind wrote:
> Fernando,
>
> No reason that I can think of.  That code predates my involvement.
>
> thanks,
> --Barry
>

We will try and fix it then.

Thanks Barry.

Regards,
Fernando



> Fernando Nasser wrote:
>
>> Can you someone tell me why we do not implement this?  The comment
>> does not explain why the "NOT!".
>>
>> All we have to do is to properly truncate the received values. If this
>> is a good programming practice or not it is debatable, but it is in
>> the JDBC standard anyway.  It may even be useful for some applications
>> out there.
>>
>>
>>     /*
>>      * Sets the maxFieldSize - NOT! - We throw an SQLException just
>>      * to inform them to stop doing this.
>>      *
>>      * @param max the new max column size limit; zero means unlimited
>>      * @exception SQLException if a database access error occurs
>>      */
>>     public void setMaxFieldSize(int max) throws SQLException
>>     {
>>         throw new PSQLException("postgresql.stat.maxfieldsize");
>>     }
>>
>
>
>
>


--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9