Project

General

Profile

« Previous | Next » 

Revision 9d9a4a86

Added by Andreas Müller almost 6 years ago

ref #7369 remove unwanted commits

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/Source.java
26 26
import org.apache.http.MethodNotSupportedException;
27 27
import org.apache.log4j.Logger;
28 28

  
29
import eu.etaxonomy.cdm.common.AccountStore;
30 29
import eu.etaxonomy.cdm.database.ICdmDataSource;
31 30
import eu.etaxonomy.cdm.database.update.DatabaseTypeNotSupportedException;
32 31

  
......
491 490
    	}
492 491
    }
493 492

  
494
    public static void main(String[] arg){
495
        Source source = EDAPHOBASE8();
496
        ResultSet a = source.getResultSet("SELECT count(*) FROM tax_taxon");
497
        try {
498
            a.next();
499
            long size = a.getLong(1);
500
        } catch (SQLException e) {
501
            // TODO Auto-generated catch block
502
            e.printStackTrace();
503
        }
504
        System.exit(0);
505
    }
506

  
507
    private static Source EDAPHOBASE8(){
508
        String dbms = Source.POSTGRESQL9;  //TODO 10
509
        String strServer = "130.133.70.26";  //BGBM-PESISQL
510
        String strDB = "cdm_edapho";
511
        int port = 5432; // 5433;
512
        String userName = "postgres";
513
        return  makeSource(dbms, strServer, strDB, port, userName, null);
514
    }
515

  
516
    private static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
517
        //establish connection
518
        Source source = null;
519
        source = new Source(dbms, strServer, strDB);
520
        source.setPort(port);
521

  
522
        pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
523
        source.setUserAndPwd(userName, pwd);
524
        // write pwd to account store
525
        return source;
526
    }
527

  
528 493

  
529 494
}

Also available in: Unified diff