So basically, I am using Java, JRI (R for Java) and RJDBC (with the help of JRI), which all work out pretty well. Now, I want to make my program as foolproof as possible. Let's say, that the string SQL_command is some kind of rubbish and not really a valid SQL-statement. In that case...
re.eval("sql_data <- dbGetQuery(conn, \"" + SQL_command + "\")");
...should go wrong. My thinking goes like this: If that R command fails, there will be some kind of output in R. If everythings correct, no output. But how can I capture that possible output?
Keep in mind, that my problem is more about how to catch invalid R statements, so any other suggestion for a possible solution is also appreciated. The R output is not necessarily important, but it may be interesting anyway.
Thanks in advance!