Vivek
Vivek

Reputation: 11028

How to check if a value exists in table or not in Java?

Can anyone suggest me that how can I check if value entered by user is exist in some specific table or not through javaCode?

Upvotes: 0

Views: 1804

Answers (1)

Brian Agnew
Brian Agnew

Reputation: 272397

I'm guessing you need the JDBC tutorial first of all. That will enable you to run SQL against your DB from Java such as:

if EXISTS (select *
    from authors
    where name = 'Dan Brown')

Upvotes: 5

Related Questions