how to useLIKE operator in JSP?
Dear everyone,
i have a task in which i have to use LIKE operator to search the database and retrieve the answer..
but it is giving only in ordered form, how should i use it
i will show you the code
PreparedStatement pr=con.prepareStatement("select eid from lang where language like ? ");
# 2
i know to use LIKE operator to check a single data like
LIKE '%data%'
i am asking , how to use it , while we are getting "requestparameter as ?"
ie
<%
String s2=request.getParameter("language");
%>
<%
int i=0;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:langskill");
PreparedStatement pr=con.prepareStatement("select eid from lang where language like ? ");
pr.setString(1,s2);
# 6
i really appreciate for your response sir...
but i am not able to get that...
can u please edit the code and send me sir...
<%
String s2=request.getParameter("language");
%>
<%
int i=0;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:langskill");
PreparedStatement pr=con.prepareStatement("select eid from lang where language like ? ");
pr.setString(1,s2);
ResultSet rs=pr.executeQuery();
while (rs.next ())
{
String eid = rs.getString("eid");
out.println(eid);
}
//out.println("no employee are found ");
}
catch(Exception e)
{
System.out.println(e);
}
%>