duplicate entry problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: duplicate entry problem

  1. #1
    Join Date
    Nov 2004
    Posts
    29

    duplicate entry problem

    hello


    i have a jsp form, from that i have insert my data to the database, and also the insert values shows on the other jsp file.

    i have used jdbc for that.

    My problem is that when i made the dulicate entry for the partocular on field value, it doesnot shows error on jsp file.

    The error is shown in tomcat server, but not in any file.

    i have also made that paticulay field not null.

    my sql table is as follows:

    Name Null? Type
    ----------------------------------------- -------- -------------
    GL_CODE NOT NULL NUMBER(4)
    GL_DESCR NOT NULL VARCHAR2(80)
    DB_AMT NUMBER(15,2)
    CR_AMT NUMBER(15,2)
    GL_TYPE VARCHAR2(2)
    GL_PCT NUMBER(4,2)

    plz help me..

    plz provide me query for that..

    thanx

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    I've had the same problem myself.
    Isn't it possible to enclose the db insert/update w. a try/catch for duplicate keys and formulate a reasonalble response back to the client when it occurs? If not, you could do a quick lookup prior to the insert/update and detect the duplicate there.
    eschew obfuscation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center