Java programming
Hi,
I have written a call to a procedure which returns me an XML output. The output is of type CLOB.
I had tried using a getString(). My output datatype was CLOB. When i did so the XML output on Java side was returning me NULL. I resolved the issue by using clob object. But why did using getString() fail?
[326 byte] By [
Kripaa] at [2007-11-27 4:30:49]

> Hi,
>
> I have written a call to a procedure which returns me
> an XML output. The output is of type CLOB.
>
> I had tried using a getString(). My output datatype
> was CLOB. When i did so the XML output on Java side
> was returning me NULL. I resolved the issue by using
> clob object. But why did using getString() fail?
Because there is a bug in the driver. Complain to the driver vendor.
>
> Because there is a bug in the driver. Complain to the
> driver vendor.
To clarify it is not a bug to have a situation where getString would not work but it is a bug if that has wrong behaviour instead. The driver in your case should be throwing a SQLException if an attempt is made to read the field in an inappropriate manner not return null.
PS you are another one today with a just terrible subject line. Please use meaningful and specific subject lines. Java programming is not a specific subject line on this site.
It is up to the drevier to what extent it is willing to convert between different data types.
Whereas an older Oracle driver converted silently between numeric and string parameters, that is, it accepted the VARCHAR type to be bound to a stored procedure parameter which was actually numeric, and setString worked on it (provided the value was okay), a later version choked on it.
> It is up to the drevier to what extent it is willing
> to convert between different data types.
>
Hello?
I stated this several times already.
It is WRONG however for a driver to silently return a null when it gets a request for conversion that it doesn't want or is unable to do.
That's why it is a bug. Not because it isn't doing the conversion. Because it is returning an incorrect value. It would not be a bug if it was throwing a SQLException.