I'm using org.apache.ojb.broker.query.Criteria and doing the following: searchTerm = "%rt%; Criteria c = new Criteria(); c.addLike("%", searchTerm);
IContainer container = Container.getContainer(c);
Whenever I run this in my action, I get a SQLException. I want to be able to search all the fields in a given table without having to write out all the columns for the given table. Is there a quick way to do this?
By the way, the SQL code that is generated by this is similar to SELECT A0.column1,A0.column2,etc. FROM container A0 WHERE % LIKE '%rt%'
Neither JiG Beginner (where the original was before I deleted it) nor JiG Advanced (where this duplicate is) is appropriate for this message. I'm going to move this to our Other Open Source Projects forum, and let's see how you do over there. Another good choice might have been our JDBC forum. Please don't post duplicate threads, though.
Maybe I should explain why I am wanting to do this. That way, someone may be able to help me come up with a different way of doing this, if it's not possible to do it the way I want/need to. I am trying to create a search feature for my webapp. I need to be able to search the ENTIRE database for a given string. This includes all field names of all non-OJB tables. The only thing the webapp will know before running my searches is the search string that will be past to it from the current html form. Any ideas will be welcome, thanks.