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);
}
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);
}
}
Aggregations