db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: checking if table exists
Date Thu, 04 Oct 2007 04:37:27 GMT

On Oct 3, 2007, at 6:44 AM, Bryan Pendleton wrote:

>>             while((result.next()) & (tableExists = false)) {
>
> Is this possibly a typo? Make sure it says:
>
>              while((result.next()) && (tableExists == false)) {
>
> You want to do a logical and, not a bitwise and;

The difference between boolean1 & boolean2 is not bitwise versus  
logical; it's between unconditional & versus conditional &&  
operation. In this case, either & or && works fine since there are no  
side effects of the assignment of false to tableExists.

> also you want to do a comparison, not an assignment.

This I agree with.

Regards,

Craig
>
> thanks,
>
> bryan
>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message