Quote:
Originally Posted by michaelb
I suspect the problem could be with parsing of the 'XXXXX' value, maybe it's related to escaping of the single-quotes.
If you post the entire section of your code that deals with assembling and executing this query, it may help.
Hi michaelb,
Here is my code:
String getEmpId=SQLQueriesHandler.getQuery("eis.toGetEmpI d");
psmt=conn.prepareStatement(getEmpId);
psmt.setString(1,empForm.getEmpName());
psmt.setInt(2,empForm.getDeptId());
System.out.println("The Query to empId with Parameters is : "+psmt.toString());
rs=psmt.executeQuery(getEmpId);
where the query will be like
select empId from empTab where empName like 'XXXXXXX' and deptId=13
And in the above code empForm is the Struts ActionForm object and getters are the form beans.
If i try to execute that as a statement it is executing well.
and also if i try to execute that query as a pprepare statement in the code itself it is executing well.
The only problem is when i try to get the query from the properties file eg:query.properties
The variable names are changed keeping the code as it is.
Thanks in Advance.
Regards,
urmyfriend