Maxi,
When comparing for equality in Java you use "==" not "=", thus the part
"lac=@receiver" would in Java be represented as "lac==@receiver".
As for the LIKE-thingy you have nothing like this in Java (the standard API
that is; somebody somewhere surely to have implemented it somehow ;-)). But
you could try using regular expressions. Check out the regular expression
notes in the String-class description as a starting point.
--
Millian Brave
"Maxi" <di*********@hotmail.com> skrev i melding
news:3f**********************@dread14.news.tele.dk ...
I have this SQL statement and I need to change the WHERE clause in the SQL
statement to its java equivatlent. Something like this:
@command1, @username2 ,@receiver is input parameter
WHERE
(
[Test]=2
AND
(command LIKE @command1 AND Username2 LIKE @Username2)
AND
(lac is null or lac=@receiver)
)
Java equivatlent:
if( (Test == 2) & (command LIKE @command1 & username2 LIKE @username2) &
(lac is null | lac== receiver)
...........
But I have trouble with translating LIKE, is null and lac=@reciver