Statements for Oracle data fuzzy queries:
SELECT m.musicid,m.musicname,m.musicpicture,m.musiclyrics,m.musicinstruction from MUSIC m where m.musicname like '% see% ' ;
Originally, I was going to implement a fuzzy query based on the keywords I entered, by invoking the fuzzy query in action after the entity Class (entity), the Data Access Layer (DAO), and the Business Logic Layer (BIZ) encapsulation.
Tried a lot of SQL did not use the hint as "not correct statement"
For example:
Sql= "Select M.musicid,m.musicname,m.musicpicture,m.musiclyrics,m.musicinstruction from MUSIC m where m.musicname like '% ' + '?% ' "; <strong><span style=" color: #ff0000; " >//Error Statements </span></strong>
The question mark and quotation mark to swap or not to be the correct SQL statement.
Finally, I can only handle SQL directly in the action method in Struts2
String Searchname=req.getparameter ("Searchname"); the//jsp page passes over the search keyword string sql= "select M.musicid,m.musicname,m. Musicpicture,m.musiclyrics,m.musicinstruction from MUSIC m where m.musicname like<span style= "color: #ff0000;" > '% ' +searchname+ "% '" </span>;//SQL statement for fuzzy query dbutil util = new Dbutil (); <span style= "White-space:pre" ></span>resultset rs =util. Query (SQL); ...... <span style= "color: #6600cc;" > The next step is to process the SQL statement </span>
Finally, the fuzzy query is realized by the method above
JSP page code:
<s:form action= "Music_fuzzyquerymusicinfo.action" method= "POST" ><input type= "text" name= "SearchName" id= " Searchname "placeholder=" song name " /><input type=" Submit "value=" Search /></s:form>
Oracle Fuzzy query (the condition that the JSP page passes over)