I want to know if there is any way to convert a String
to Java compilable code.
I have a comparative expression saved in a database field. I want to re
You shouldn't. Really!
Are you inventing another enterprise rules engine?. You might want to read these links.
Consider the fact that the only people that is skilled enough to write code and then insert it into a database, probably are having an editor and a compiler anyway...
The compiler will catch all those pesky syntax errors and you can even test the code! Remember that editors and compilers, and even computer languages were invented to help the programmer to comfortably write comprehensible code with a reasonable effort.
While I'm at it: read about the complicators gloves too!