Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2008

    Unanswered: new table is able to fetch the data but not able to store the data

    Hello Experts,
    Hope all are doing good.
    I am quite new to DB.
    I am using java swings and SQL Server Management Studio Express (2).

    I want one new table in my DB suppose table B which must be like one existing table A.

    So for that I created one table with the same columes and same datatype as in table A.

    and In the java page I changed table A name by table B.
    But I this doesn't work in a right way.

    I am able to fetch the data from the new table,I am able to delete the data of new table but I am not able to add any data in the new table via application.I checked the code already.
    Please suggest me what to do?


  2. #2
    Join Date
    Jan 2007
    Provided Answers: 10
    It intrigues me that you have two identical tables in your database, can you tell us why this is?

    Are you getting any error messages? Can we check the code for errors?
    Home | Blog

  3. #3
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    I haven't used it in a while, but I think that the Java Swing library depends on a table attribute to allow INSERT and UPDATE operations. Depending on the version of the Swing library, the needed table attribute can be either a PRIMARY KEY constraint or a UNIQUE INDEX.

    If you apply the PRIMARY KEY constraint, your code should work on your new table.


  4. #4
    Join Date
    Nov 2008
    First of all I created new table B same like table A because I want same functionality but want to store different data in table B.

    Secondly as per the suggestion I applied the primary key constraint to the new table but still facing the same problem.
    Here I am attaching one doc.Please take a look.As when I click on edit and save,it delete the record and when I will try to add and save it does nothing.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts