I am trying to do a simple if Statement using the ? pattern. Resulting in an "Not a statement"- Error. Can someone please explain to me why this bullshit is not happening using a normal if statement?
cursor.isNull(0) ? insert_SQL_RSServer.bindNull(0) : insert_SQL_RSServer.bindLong(0, cursor.getLong(0)); // id
The ternary conditional operator is an expression, and it must have a return type, which is determined by the types of the 2nd and 3rd operands.
Therefore, if your
bindLong() methods have
void return type, they can't be used in this operator.