Has anyone had a problem using prepared statements with ? that return multiple rows? In my BMP bean I had the following prepared statement:
pstmt = conn.prepareStatement("select "+HDT +" from "+TABLE_NAME+" where "+HUB_NAME+" = ?");
This would return nothing when executed, but when I created a prepared statemnt as follows it worked:
pstmt = conn.prepareStatement("select "+HDT+" from "+TABLE_NAME+" where "+HUB_NAME+" = '"+hub+"'");
The reason I am asking is because I am now using CMP and I am seeing the same response when it tries to plug in my "hub" for the ?. Here is the server debug of the CMP prepared statement:
Executing SQL: SELECT t0_a.hdt FROM HDT t0_a WHERE t0_a.hub_name = ?
Any ideas, would be greatly appreciated.
nevermind. The DBA created the column as CHAR not VARCHAR2 so I had to add spaces. Does anyone know how to trim a column using ejb-ql?