Hello,
I am attempting to use prepared statements and am running into some difficulty: I am uncertain of the proper syntax.
If I have this query:
ResultSet ivRs = con.createStatement().excuteQuery(select x_id from tbl_y where fname like '%" + param + "%'");
It works as expected
How to I implement this as a prepared statement ? This is what I have tried:


PreparedStatement ivPs = con.preparestatement(select x_id from tbl_y where fname like ?");
ivPs.setString(1,someParam);
This executes, returns nothing - it should


This:
PreparedStatement ivPs = con.preparestatement(select x_id from tbl_y where fname like '%?%' ");
ivPs.setString(1,someParam);
Fails


This:
PreparedStatement ivPs = con.preparestatement(select x_id from tbl_y where fname like ?");
ivPs.setString(1," '%" + someParam + "%' ");
This executes, returns nothing


I am at a loss...
Any guidance would be greatly appreciated.
Thank you.
Michael MacIntyre






-- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to