jdbc1 AbstractJdbc1Statement setObject() does not work with some Stream types

From: Paulo Eduardo Azevedo Silveira <peas(at)linux(dot)ime(dot)usp(dot)br>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: Gilmar Gimenes Rodrigues <rgil(at)linux(dot)ime(dot)usp(dot)br>
Subject: jdbc1 AbstractJdbc1Statement setObject() does not work with some Stream types
Date: 2002-11-19 20:38:39
Message-ID: Pine.LNX.4.21.0211191823420.17973-100000@epicurus.linux.ime.usp.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello!

Inside of public void setObject(int parameterIndex, Object x) throws
SQLException, there is NO if to see if it X is instanceof
InputStream. This was crashing my application when trying to pass a
ByteArrayInputStream as argument to setObject, since it does no fit in any
of the instanceofs, and get into the alst line, where it is serialized
(and a completely strange exception message is thrown from other point)

http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java?rev=1.13&content-type=text/x-cvsweb-markup

I ve made a CVS patch for it, if anyone is interested in these couples of
lines. It is just a if-instanceof-InputStream that delegates the setObject
to setBinaryStream with lenght equals to inputstream.available()

One more thing: all those imports something.* make really hard for the
other coders to find where the classes are being imported from. Sorry to
be "picky".

Thanks a lot for your attention.

---------------------------------------
Paulo Silveira (www.paulo.com.br)
Grupo de Usuarios Java (www.guj.com.br)

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Scott Lamb 2002-11-19 23:05:29 Re: streaming result sets: progress
Previous Message Nic Ferrier 2002-11-19 19:00:58 Re: streaming result sets: progress