I've got a weird problem in Oracle query running from Java with Oracle 11g. The same query worked good with Oracle 10g. tool_availability is a view.
final String SELECT_SQL = "select * " +
"from tool_availability " +
"where tool_code = ? " +
"and tool_number = ? " +
"and unit = ? " +
"and part_id = ? ";
ps = con.prepareStatement(SELECT_SQL);
ps.setFetchDirection(ResultSet.FETCH_FORWARD);
ps.setFetchSize(1);
ps.setString(1, tool_code);
ps.setString(2, tool_number);
ps.setString(3, unit);
ps.setString(4, part_id);
rs = ps.executeQuery();
The query has space before and after '?' mark. The same query is not working with 11g and I'm getting below error:
java.sql.SQLException: ORA-01036: illegal variable name/number
If I remove the space before and after '?' mark. The same query is working with 11g.
Could anybody give some insight what could be the problem?