package UGPGStudentsExample;

import java.sql.*;
import java.io.*;
import uk.ac.ic.doc.automed.*;
import uk.ac.ic.doc.automed.reps.*;

/*
 * An application to define the pattern repository
 */

public class DefineRepository {
  // Generic reinitialise of a repository
  public static void initialiseRepository(String sourceName)  
  throws DSRException, SQLException, IOException {
    String sa[]=new String[]{"",sourceName};

    DSR.doDropdbCommand(sa);
    DSR.doCreatedbCommand(sa);
    System.out.println("Repository "+sourceName+" initialised");
  }

  public static void main(String[] args) {
    try {
      System.out.println("AutoMed SSMD Repository Reinitialisation");
      initialiseRepository(SSMDR.getDataSourceName());

    }
    catch (SQLException se) { 
      se.printStackTrace();
    }
    catch (IOException ie) {
      ie.printStackTrace();
    }
    catch (AutoMedException ame) {
      ame.printStackTrace();
    }      
  }
}

























