how can i collect values from database using OR condition?

i have a table containing employee and language ...

I have a select box containing languages and if i select two languages and click on submit.

it should do collect all employees having either of the languages using OR condition..how can i do this out..

i have written some code and i will show u...

please give your suggstions

<%

//String eid=request.getParameter()

String s3[]=request.getParameterValues("language");

String check[] = request.getParameterValues("check");

int i=0;

int j=0;

String a="";

String ename="";

//String check

try

{

Class.forName("com.mysql.jdbc.Driver");

}

catch(ClassNotFoundException ce)

{

out.println(ce);

}

try

{

Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test");

PreparedStatement pStmt = con.prepareStatement("select lang.ename from lang where language like ? ");

if(check ==null)

{

for ( i = 0; i < s3.length; i++)

{

if(i < s3.length - 1)

{

a=a + s3[i] +",";

}

elseif(i < s3.length)

{

a = a + s3[i] ;

}

pStmt.setString(1,"%" + a +"%");

}

}

else

{

for ( i = 0; i < s3.length ; i++)

{

if(i < s3.length - 1)

{

a=a + s3[i] +",";

}

else

{

a = a + s3[i] ;

}

pStmt.setString(1, a );

}

}

%>

<table width="15%" border="1">

<tr>

<td><div align="center">Employees</div></td>

</tr>

<%

ResultSet rs=pStmt.executeQuery();

while (rs.next ())

{

ename = rs.getString("ename");

%>

<tr>

<td><%=ename%></td>

</tr>

<%

}

%>

</table>

<%

}

catch(SQLException e)

{

System.out.println(e.getMessage());

}

%>

[3757 byte] By [senthil_yogaa] at [2007-11-27 7:30:12]
# 1
This has nothing to do with JSP/JSTL. Here are some SQL tutorials: http://www.google.com/search?q=sql+tutorial
BalusCa at 2007-7-12 19:10:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
can any one give ur suggestions please
senthil_yogaa at 2007-7-12 19:10:22 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...