Originally posted by Paul Clapham:
You normally wouldn't parse any SQL queries. ("Parsing" is the act of translating a text format into an internal data structure, so parsing an SQL query is what the database driver does.)
But if you're asking whether it's a good practice to construct an SQL query from some base text and some parameters, like this:
then no, that isn't a good practice. It leaves you open to SQL injection attacks (you could look that up). The better practice is to use a PreparedStatement for your SQL:
Originally posted by Bear Bibeault:
This actually applies to any web application, Struts-based or otherwise. It's considered a very poor practice.
Originally posted by Merrill Higginson:
Those "thingies" are called EL (Expression Language) Expressions. Their purpose is to translate data that exists in JavaBean object into a form that can be displayed on a JSP page. For example, the EL expression ${myBean.foo} is similar to writing <%= myBean.getFoo() %>.
Since you're writing Java code instead of a JSP page, EL expressions aren't going to be of much use to you. You will want to use the equivalent Java exressions to retrieve the data. Example:
[ July 02, 2008: Message edited by: Merrill Higginson ]
Originally posted by Campbell Ritchie:
... Your repeated = null calls are redundant; your local variable will vanish when the method completes anyway...
Originally posted by Pho Tek:
This is how you would do it:
Originally posted by Ernest Friedman-Hill:
Yes, people do indeed do that sort of thing sometimes. Be careful, because that number you give is only about a factor of 20 smaller than the largest positive int value; otherwise you'll get overflow.
Originally posted by Pho Tek:
All Classes automatically inherit from Object.
Since you've not overriden the Object#toString() method, it uses that when you pass an instance of myPolygon to System.out.println( .. ).
In summary, implement myPolygon#toString to print out all the points and name.