[ucn-dev] XRow implementation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[ucn-dev] XRow implementation

Dan Corneanu
Hi,
I am porting the ucbhelper :: PropertyValueSet from CPP to java.
I have 2 questions:
1. Should the get*(int columnIndex) methods attempt a conversion between
the type of the value stored in the specified column and the type of the
value requested as a result? or should it consider any type mismatch as
an error? The CPP implementation make use of the
com.sun.star.script.Converte,. is this the correct way of handling this
situation?

2. For the get*(int columnIndex) methods that are requesting primitive
types, how should the implementation handle the case when the value
stored in the column is null ? Should I throw an
com.sun.star.sdbc.SQLException os should I implement a mechanism of
returning a default value (ex. 0 for long/byte/short and false for
boolean)?

see: public long getLong(int index) throws SQLException

Best regards,
cdan.

--
Dan Corneanu
Sava Technologies SRL
Eroilor de la Tisa nr. 33
300553 Timisoara
Romania

Phone: +40 256 201269, +40 356 101412
Mobile: +40 721 723604
E-mail: [hidden email]
http://www.savatech.ro


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [ucn-dev] XRow implementation

Kai Sommerfeld
Hi Dan,

On 28.06.10 14:13, Dan Corneanu wrote:

> Hi,
> I am porting the ucbhelper :: PropertyValueSet from CPP to java.
> I have 2 questions:
> 1. Should the get*(int columnIndex) methods attempt a conversion between
> the type of the value stored in the specified column and the type of the
> value requested as a result? or should it consider any type mismatch as
> an error? The CPP implementation make use of the
> com.sun.star.script.Converte,. is this the correct way of handling this
> situation?
>
  Yes.

> 2. For the get*(int columnIndex) methods that are requesting primitive
> types, how should the implementation handle the case when the value
> stored in the column is null ? Should I throw an
> com.sun.star.sdbc.SQLException os should I implement a mechanism of
> returning a default value (ex. 0 for long/byte/short and false for
> boolean)?
>
  No exception. Compute a default 'null' value.

->
<http://api.openoffice.org/docs/common/ref/com/sun/star/sdbc/XRow.html#wasNull>

- Kai.

--
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]