This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Re: Checking for duplicate rows

 
Ashwin Tadepalli
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What is the easiest way to check for the insertion of duplicate rows in a database table from a client program.I have tried used using try catch block statements and then raising an exception,but it does not solve my problem.All of my JDBC processing is done through a servlet,so if I try to run the client program and try to insert some duplicate entries it stops my servlet engine.I can see that it has raised that SQL exception on the console of my Visual Age tool,but I want some other method which will not let my servlet engine to stop but tell in advance to the client program(on the command prompt) that you are trying to insert some duplicate entries.Any suggestions on this topic are welcome.
Thanking You
Ashwin
 
Monty Ireland
Ranch Hand
Posts: 161
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the kiss() method...
exec a select using the table's primary key...
if you get a row count GT 0..
then you have a duplicate...

------------------
Multi-Platform Database Developer
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic