How to pass parameters to query?
问题 I'm trying to write a query for my application, but I'm having some troubles. I need to pass as a parameter one field of my database, like: SELECT name, phone, email FROM company WHERE $P{clause} = $P{key} ORDER BY $P{order} Because WHERE clause and ORDER BY clause are dynamic for the user to select. Using $P{} it didn't work. 回答1: There are two syntax expressions for parameter referencing in JasperReports : $P{} and $P!{} . $P{paramName} syntax is using mostly for setting WHERE input