Package org.dbwiki.driver.rdbms

Examples of org.dbwiki.driver.rdbms.DatabaseConnector


   
    try {
      System.out.print("Enter the name of the wiki you want to delete: ");
      // jcheney: got rid of implicit upper-casing
      String name = (new BufferedReader(new InputStreamReader(System.in))).readLine();
      DatabaseConnector connector = new DatabaseConnectorFactory().getConnector(org.dbwiki.lib.IO.loadProperties(new File(args[0])));
      Connection con = connector.getConnection();
      Statement stmt = con.createStatement();
      stmt.execute("DELETE FROM " + RelationDatabase + " WHERE " + RelDatabaseColName + " = '" + name + "'");
      System.out.println("DELETE FROM " + RelationDatabase + " WHERE " + RelDatabaseColName + " = '" + name + "'");
      stmt.close();
      connector.dropDatabase(con, name);
      /*Statement stmt = con.createStatement();
      stmt.execute("DELETE FROM " + RelationDatabase + " WHERE " + RelDatabaseColName + " = '" + name + "'");
      stmt.close();*/
      con.close();
    } catch (Exception exception) {
View Full Code Here


    // Creates the following tables: _database, _presentation, _user
    try {
      File configFile = new File(args[0]);
      File userFile = new File(args[1]);
      Properties configProperties = org.dbwiki.lib.IO.loadProperties(configFile);
      DatabaseConnector connector = new DatabaseConnectorFactory().getConnector(configProperties);
      List<User> users = User.readUsers(userFile);
      connector.createServer(users);
    } catch (Exception exception) {
      exception.printStackTrace();
      System.exit(0);
    }
  }
View Full Code Here

    String path = args[2];
    String username = args[3];
   
    try {
      Properties properties = org.dbwiki.lib.IO.loadProperties(configFile);
      DatabaseConnector connector = new DatabaseConnectorFactory().getConnector(properties);
      //TODO #server: Use non-web wiki server for this
      WikiServer server = new WikiServerStandalone(properties);
      /*
       * DatabaseWiki wiki = null;
      for (int iWiki = 0; iWiki < server.size(); iWiki++) {
        if (server.get(iWiki).name().equalsIgnoreCase(wikiName)) {
          wiki = server.get(iWiki);
          break;
        }
      }*/
      DatabaseWiki wiki = server.get(wikiName);
     
      // [wiki] should never be null
      assert(wiki != null);
     
      Database database = wiki.database();
           
      Connection con = connector.getConnection();
      con.setAutoCommit(false);

      ImportPresentationFiles p = new ImportPresentationFiles(server, wiki, database, username);
      p.loadPresentationFile(path + wikiName + ".css", PresentationFileType.CSS);
      p.loadPresentationFile(path + wikiName + ".layout", PresentationFileType.Layout);
View Full Code Here

      // [wiki] should never be null
      assert(_wiki != null);
     
      // Commit the presentation files.
     
      DatabaseConnector connector = new DatabaseConnectorFactory().getConnector(properties);
      Connection con = connector.getConnection();
      con.setAutoCommit(false);

      loadPresentationFile(args.cssTemplate, PresentationFileType.CSS,user);
      loadPresentationFile(args.htmlTemplate, PresentationFileType.Template,user);
      loadPresentationFile(args.layout, PresentationFileType.Layout,user);
View Full Code Here

      System.out.println("Usage " + commandLine);
      System.exit(0);
    }
   
    try {
      DatabaseConnector connector = new DatabaseConnectorFactory().getConnector(org.dbwiki.lib.IO.loadProperties(new File(args[0])));
      System.out.print("Do you want to drop all wikis (Y, N): ");
      String answer = (new BufferedReader(new InputStreamReader(System.in))).readLine().toUpperCase();
      connector.dropServer(answer.equalsIgnoreCase("Y"));
    } catch (Exception exception) {
      exception.printStackTrace();
      System.exit(0);
    }
  }
View Full Code Here

TOP

Related Classes of org.dbwiki.driver.rdbms.DatabaseConnector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.