hi,
before you enter the new record, just check with
<code>
Statement st=DriverManager.getConnection().createStatement();
ResultSet rs =st.executeQuery("SELECT * FROM yourTable WHERE ...");// (instead of ... put it the values entered in īthe form)
boolean valuesAlreadyInTable =rs.hasNext();
 
if (valuesAlreadyInTable)
    // showErrorPage or sth
else
    // enter new record
</code>
if there already exists a record with the same values.
 
hope this helps!
 
-mw
 
 
----- Original Message -----
From: mike dizon
Sent: Wednesday, November 21, 2001 4:42 AM
Subject: verifying database entries

Hi All,
 
I'm trying to make sure that an entry in a database doesn't exist before I enter data into the database -- based on information entered in on a form.
 
How do I go about doing that? Any help would be appreciated.
 
Thanks
MD
 
 

Reply via email to