Re: jdbc question
From: Ann (Ann_at_nospam.invalid)
Date: 12/30/04
- Next message: qazmlp: "Compatibility of Java 1.2 & 1.4 interfaces"
- Previous message: Ryan Stewart: "Re: maintain data in tabs in JSP pages"
- In reply to: jmt: "jdbc question"
- Next in thread: Chris Uppal: "Re: jdbc question"
- Reply: Chris Uppal: "Re: jdbc question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Dec 2004 03:11:09 GMT
"jmt" <ejbengine@yahoo.com> wrote in message
news:cqud3s$i58$1@ctb-nnrp2.saix.net...
> Using JDBC , what would be a more elegant way of determining whether or
> not a record already exists in a DB table before inserting it?
>
> Jeff
> Registered Linux user number 366042
Why do you want to know? Let me suggest that you don't.
What would you do if you found out that the record existed
already? My guess is that you would not insert it. And if
the record did not exist? Then you would insert it. The
result is the same, the record exists when you are done.
So just do the insert and ignore the error. Of course it
is perfectly legal for two rows in the same table to
contain the same values, so if you only want one row,
you would need to set that in the database itself.
- Next message: qazmlp: "Compatibility of Java 1.2 & 1.4 interfaces"
- Previous message: Ryan Stewart: "Re: maintain data in tabs in JSP pages"
- In reply to: jmt: "jdbc question"
- Next in thread: Chris Uppal: "Re: jdbc question"
- Reply: Chris Uppal: "Re: jdbc question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|