because if database or ur program are composing this string than they can give the value also .. but if its stored as a string in a column .. then only u need expression evaluator
Main Topics
Browse All TopicsProblem is of converting a string into expression.
From database we find a string like : "((A>B) AND (B>C))"
When we put the value in it the string will become like "((15>10) AND (10>8))"
Now this string has to be used in a way so that it return me true ( for the above mentioned scenario)....
How can i handle this in Java
Thankz
Sanjay
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you donnot want to make your own expression evaluator .
You can download BeanShell core from http://www.beanshell.org/ ,
and embed BeanShell interpreter in your application as an expression evaluator like:
bsh.Interpreter i = new bsh.Interpreter();
Object result=i.eval("((15>10) && (10>8))");
System.out.println("result
You can find more information here http://www.beanshell.org/m
Try http://jep.sourceforge.net
Maybe it is a little bit oversized for your problem. But I guess that you posted a simple example and that the expressions in your DB are much more complex.
JEP supports binding your variables to values very nicely.
See the code in the demo section to evaluate if it suits your needs
ssaluja:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- Split points between bored2cpp and csar
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Venabili
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: akshayxxPosted on 2002-10-29 at 19:20:20ID: 7385953
hmm u need some expression evaluator ..
where r u getting values from .. separate table in database ??
and this expression ..is it stored as a string in databse column .. or what .. i mean whats the way that u r getting this string composed from ..