Changeset 14336


Ignore:
Timestamp:
2007-08-08T09:23:53+12:00 (15 years ago)
Author:
qq6
Message:

delete all rows defore adding new records

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/util/txt2usersDB.java

    r14334 r14336  
    1919        DerbyWrapper dw=new DerbyWrapper();
    2020        dw.connectDatabase(args[1],false);
     21        boolean delete_rows = dw.deleteAllUser();
     22        if (!delete_rows){
     23        System.out.println("Couldn't delete rows of the users table");
     24        System.exit(0);
     25        }
    2126        String username=null;
    2227        String password=null;
     
    4651        if (str.equals("----------------------------------------------------------------------")){
    4752            if ((username!=null) && (password!=null) && (groups!=null) && (accountstatus!=null) && (comment!=null)){
     53            dw.connectDatabase(args[1],false);
    4854            dw.addUser(username, password, groups, accountstatus, comment);
    4955            username=null;
Note: See TracChangeset for help on using the changeset viewer.