Hi William

In fact, I tried the same thing after sending of my original mail. I figured out
that the field can not be of 'char' data type. It should be String. This is
because there is no getChar() method in java.sql.Resultset and the container
generates code like this:

     married = (char) __WL_11_rs.getString(3);

Ultimately it is a compiler error.

My initial opinion is that there is no standard solution for this, although I
may be wrong. The solution should have to be JDBC driver dependant. Because,
when PreparedStatement.setBoolean() is called,  JDBC-ODBC bridge may translate
true and false it to '0' and '1' respectively; Oracle's Thin driver may
translate to 'Y' and 'F'; some other driver may do 'T'  and 'F'!

--
shiv
[EMAIL PROTECTED]


"Louth, William (Exchange)" wrote:

> Hi Shiv,
>
> If your database, jdbc driver, or application server does not support the
> conversion then the following is a solution:
>
> // bean fields
> private boolean _married;
> public char married; // cmp field
>
> in ejbLoad...
>   _married = (married=='Y'); // the married cmp field will be set prior to
> this call
>
> in ejbStore...
>   married = (_married) ? 'Y' : 'N'; // synch the cmp field before storing..
> this is why WebLogic should call ejbStore and then try to detect change
>
> in ejbCreate...
>   _married = married;
>
> // bean methods
> boolean isMarried() { return _married; }
> isMarried(boolean married) { _married = married; }
>
> Very quickly and untested but I think this should be a workaround. There is
> probably something more elegant in the jdbc driver or appserver manual.


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to