DBとJSPを使って、テキストボックスの中で、半角スペースまたは全角スペースで、複数キーワードによる、あいまい検索をしたいのですが、今イチよくわかりません。
<!--index.html-->
<html><head><title></title><head><body>
<form action="./result.jsp">
<input type="text" name="a" /><input type="submit" />
</form>
</body></html>

<!--result.jsp-->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.sql.*"%>
<html><head><title></title><head><body>
<%
//エンコード
String b = new String(request.getParameter("a").getBytes("8859_1"),"UTF-8");
//DB接続
Class.forName("ドライバ名");
try{
ResultSet rs = DriverManager
.getConnection("jdbc:odbc:データソース名","","")
.createStatement()
//index.htmlから、パラメータを取得して、あいまい検索する。
.executeQuery("select * from テーブル where タイトル like '%"+b+"%';");
while(rs.next()){
//検索して見つかったデータを表示する。
out.println(rs.getString("タイトル") + "<br />");
}
rs.close();
}catch(Exception e){
}finally{}
%>
</body></html>