p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

java_databases thread: how to compare a string with the word in database?


Message #1 by "m" <meikuen_chung@h...> on Thu, 28 Nov 2002 03:22:28
> hello,
i>  am using microsoft sql server to store my database. from the java 
p> rogram, how can i compare the word with the word in database to 
determine 
t> hat it exists in database? i need a detail of it because i am just new 
to 
j> ava and sql.
i>  should use java fuction isequal or == ?

> thank you

Hi;

if you have a String a and you want to see if it equals String b:

a.equals(b);// returns boolean (method in String class)

or

a.equals("string from database");

Cheers,

DA

  Return to Index