Paul Campbell wrote:Kumar,
You can check for NULL... where mycolumn IS NULL (or mycolumn IS NOT null).
omar al kababji wrote:I think you should place your strings between single quotations for example the file name should be ' + file_name + '
Why not let the DB handle it using some UNIQUE constraint and catch the constraint violation exception in Java? This is definately a database concern.Revanth reddy wrote:to check the exact duplicate exits in the db
Bauke Scholtz wrote:Why not let the DB handle it using some UNIQUE constraint and catch the constraint violation exception in Java? This is definately a database concern.
That said, you should be using preparedstatement placeholders instead of string concatenations.
At any way, I would discuss it with the DBA and/or project lead. This is a poor datamodel.Revanth reddy wrote:
Bauke Scholtz wrote:Why not let the DB handle it using some UNIQUE constraint and catch the constraint violation exception in Java? This is definately a database concern.
That said, you should be using preparedstatement placeholders instead of string concatenations.
Thanks for reply.. but unfortunately this table doesn't have unique constraints and any of constraints. that is the reason why i am checking for exact row duplicate in the db.
omar al kababji wrote:
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
|