Package org.dbwiki.test

Source Code of org.dbwiki.test.TestDatabaseReader

package org.dbwiki.test;

import java.io.File;
import org.dbwiki.data.resource.NodeIdentifier;
import org.dbwiki.driver.rdbms.DatabaseReader;
import org.dbwiki.driver.rdbms.PSQLDatabaseConnector;
import org.dbwiki.driver.rdbms.RDBMSDatabase;
import org.dbwiki.web.server.WikiServerStandalone;

public class TestDatabaseReader {
  public static void main(String[] args) {
      try {
          WikiServerStandalone wikiserver=new WikiServerStandalone(org.dbwiki.lib.IO.loadProperties(new File(args[0])));
        PSQLDatabaseConnector psql = new PSQLDatabaseConnector("jdbc:postgresql://localhost", "dbwiki", "password");
        RDBMSDatabase database= new RDBMSDatabase(wikiserver.get(1), psql);
        NodeIdentifier nodeidentifier= new NodeIdentifier();
        DatabaseReader.get(psql.getConnection(), database, nodeidentifier);
          database.query("wpath://child::COUNTRY/child::NAME");
          database.query("wpath://COUNTRY[CATEGORY/PROPERTY/*='Europe']/NAME");
          database.query("wpath://COUNTRY[NAME='United States']/CATEGORY[NAME='Economy']/PROPERTY[NAME='GDP (purchasing power parity)']");
          System.out.println(wikiserver.size());
          
        
  


      } catch (Exception exception) {
        exception.printStackTrace();
        System.exit(0);
      }
      
     }
  
}
TOP

Related Classes of org.dbwiki.test.TestDatabaseReader

TOP
Copyright © 2018 www.massapi.com. 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.