Code example for Scanner

Methods: nextLine

0
    private static Keyspace keyspace;
    private static String cf = "StandardLong1";
    public static void main(String arg[]) {
        //Read User Inputs 
 
        Scanner scanner = new Scanner(System.in);
        System.out.print("Host: ");
        String host = scanner.nextLine();
        System.out.print("Port: ");
        String port = scanner.nextLine();
        System.out.print("Tenant Id: ");
        String tenantId = scanner.nextLine();
        System.out.print("Tenant Password: ");
        String tenantPasswd = scanner.nextLine();
        System.out.print("Keyspace:");
        keyspaceName = scanner.nextLine();
        cluster=ExampleHelper.createCluster(host,port,tenantId,tenantPasswd);
        //Create Keyspace 
        KeyspaceDefinition definition = new ThriftKsDef(keyspaceName);
        cluster.addKeyspace(definition);
        try {