Search in sources :

Example 1 with AdminDatabaseServer

use of cbit.vcell.server.AdminDatabaseServer in project vcell by virtualcell.

the class MathVerifier method createMathVerifier.

public static MathVerifier createMathVerifier(String dbHostName, String dbName, String dbSchemaUser, String dbPassword) throws Exception {
    ConnectionFactory conFactory = null;
    KeyFactory keyFactory = null;
    new cbit.vcell.resource.PropertyLoader();
    String driverName = "oracle.jdbc.driver.OracleDriver";
    String connectURL = "jdbc:oracle:thin:@" + dbHostName + ":1521:" + dbName;
    // 
    // get appropriate database factory objects
    // 
    conFactory = DatabaseService.getInstance().createConnectionFactory(driverName, connectURL, dbSchemaUser, dbPassword);
    keyFactory = conFactory.getKeyFactory();
    AdminDatabaseServer adminDbServer = new LocalAdminDbServer(conFactory, keyFactory);
    return new MathVerifier(conFactory, keyFactory, adminDbServer);
}
Also used : ConnectionFactory(org.vcell.db.ConnectionFactory) BigString(org.vcell.util.BigString) PropertyLoader(cbit.vcell.resource.PropertyLoader) KeyFactory(org.vcell.db.KeyFactory) AdminDatabaseServer(cbit.vcell.server.AdminDatabaseServer)

Example 2 with AdminDatabaseServer

use of cbit.vcell.server.AdminDatabaseServer in project vcell by virtualcell.

the class FunctionFileCrawler method main.

/**
 * Insert the method's description here.
 * Creation date: (6/27/2006 1:33:58 PM)
 * @param args java.lang.String[]
 */
public static void main(String[] args) {
    ConnectionFactory conFactory = null;
    try {
        String username = null;
        String outputdir = ".";
        int count = 0;
        boolean SCAN_SINGLE = false;
        while (count < args.length) {
            if (args[count].equals("-h")) {
                printUsage();
                System.exit(0);
            } else if (args[count].equals("-u")) {
                count++;
                username = args[count];
                SCAN_SINGLE = true;
            } else if (args[count].equals("-o")) {
                count++;
                outputdir = args[count];
            } else {
                System.out.println("Wrong arguments, see usage below.");
                printUsage();
                System.exit(1);
            }
            count++;
        }
        PropertyLoader.loadProperties();
        conFactory = DatabaseService.getInstance().createConnectionFactory();
        KeyFactory keyFactory = conFactory.getKeyFactory();
        AdminDatabaseServer adminDbServer = new LocalAdminDbServer(conFactory, keyFactory);
        FunctionFileCrawler crawler = new FunctionFileCrawler(adminDbServer, outputdir);
        if (SCAN_SINGLE) {
            crawler.scanAUser(username);
        } else {
            crawler.scanAllUsers();
        }
        System.exit(0);
    } catch (Exception ex) {
        ex.printStackTrace(System.out);
    } finally {
        try {
            if (conFactory != null) {
                conFactory.close();
            }
        } catch (Throwable ex) {
            ex.printStackTrace();
        }
        System.exit(0);
    }
}
Also used : ConnectionFactory(org.vcell.db.ConnectionFactory) KeyFactory(org.vcell.db.KeyFactory) AdminDatabaseServer(cbit.vcell.server.AdminDatabaseServer) DataAccessException(org.vcell.util.DataAccessException) SQLException(java.sql.SQLException)

Aggregations

AdminDatabaseServer (cbit.vcell.server.AdminDatabaseServer)2 ConnectionFactory (org.vcell.db.ConnectionFactory)2 KeyFactory (org.vcell.db.KeyFactory)2 PropertyLoader (cbit.vcell.resource.PropertyLoader)1 SQLException (java.sql.SQLException)1 BigString (org.vcell.util.BigString)1 DataAccessException (org.vcell.util.DataAccessException)1