/** Our apps entry point */
public static void main(String[] args) throws SQLException, ClassNotFoundException {
loadDrivers();
PGtokenizer dburls;
String dbuser = null;
String dbpass = null;
if (args.length == 1 && args[0].equalsIgnoreCase("offline")) {
System.out.println("Performing only offline tests");
dburls = new PGtokenizer("", ';');
} else if (args.length == 3) {
System.out.println("Performing offline and online tests");
dburls = new PGtokenizer(args[0], ';');
dbuser = args[1];
dbpass = args[2];
} else {
System.err.println("Usage: java examples/TestParser dburls user pass");
System.err.println(" or: java examples/TestParser offline");
System.err.println();
System.err.println("dburls has one or more jdbc urls separated by ; in the following format");
System.err.println("jdbc:postgresql://HOST:PORT/DATABASENAME");
System.exit(1);
// Signal the compiler that code flow ends here.
return;
}
Connection[] conns;
conns = new Connection[dburls.getSize()];
for (int i = 0; i < dburls.getSize(); i++) {
System.out.println("Creating JDBC connection to " + dburls.getToken(i));
conns[i] = connect(dburls.getToken(i), dbuser, dbpass);
}
System.out.println("Performing tests...");
System.out.println("***");