How to detect line break while reading input ?
Hi all,
I am reading the user input from standard input.
I want to detect the line break. So that I can stop reading input and proceed processing the string.
Actually I am getting the SQL query as input and after that I am executing the same by passing it to a function.
Pl. do reply me.
Scanner scanner =new Scanner(System.in);
while(scanner.hasNext())
{
temp=scanner.next();
sql=sql.concat(" "+temp);
if(scanner.next=="\n")
break;
}
System.out.println(sql);
sqlTool.executeSQL(sql);
The above is not working properly.

