Hello,
The simplest way would be to define a unique index on the column in which you don't want duplicate values. This way the database server it self will throw an exception if such an attempt is made.
Other way is to check with a SQL statement. eg.
SELECT COUNT(1) FROM table_name WHERE dup_col_name = value_to_insert
If this query returns a count greater than 0 then it means that
value_to_insert
is already present in the table and you should not proceed with insert.
Regards,