private static void queryDatabase(String username, String password) throws IOException 
    {
        ArrayList<ArrayDeque<String>> resultsList = new ArrayList<ArrayDeque<String>>();
        ConnectionData connectionData = new ConnectionData(hostPort, hostName, dbName, username, password);
        if (readFromFile) {
            for (Query query : queryObjectList) {
                resultsList.add(query.execute(connectionData));
            }

            for (ArrayDeque<String> queryResults : resultsList) {
                //System.out.println("\nResults of query: ");
                for (String line : queryResults) {
                    writeLine(line);
                }
            }
        }
        else {
            try {
                String connectionString = "jdbc:oracle:thin:"+username+"/"+password+"@//" + hostName + ":" + Integer.toString(hostPort) + "/" + dbName;
                System.out.println("Credentials: " + username + ", " + password + ", ConString: " + connectionString);
                Connection con = DriverManager.getConnection(
                                                             connectionString,
                                                             username,
                                                             password
                                                            );

                Statement queryStatement = con.createStatement();
                ResultSet results = queryStatement.executeQuery(queryString);

                ResultSetMetaData theMetaData = results.getMetaData();
                int columnsNumber = theMetaData.getColumnCount();
                while (results.next()) {
                    for (int i = 1; i <= columnsNumber; i++) {
                        if (i > 1) writeLine(",  ");
                        String columnValue = results.getString(i);
                        writeLine(columnValue + " " + theMetaData.getColumnName(i));
                    }
                    writeLine("\n");     
                }           
            }
            catch(java.sql.SQLException e)
            {
                e.printStackTrace();
            }
        }
    }