Este es Mi DAO
Código PHP:
import java.sql.*;
import Conexion.ConexionSql;
import Beans.ConsCod;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Jorge Lopez
*/
public class ConsCodDAO {
public List Consultar(ConsCod conscod)
{
List listacods = new ArrayList();
try
{
ConexionSql conn = new ConexionSql();
Connection c = conn.getConexion();
String sql = "Select OITM.ItemCode, OITM.ItemName, OITM.frozenFor From OITM "
+ "Where OITM.ItemName Like ? AND OITM.frozenfor='N'";
PreparedStatement ps = c.prepareStatement(sql);
ps.setString(1, "%" + conscod.getDescuno() + "%");
ResultSet res;
ConsCod consc;
for(res = ps.executeQuery(); res.next(); listacods.add(consc))
{
consc = new ConsCod();
conscod.setCoduno(res.getString("ItemCode"));
conscod.setDescuno(res.getString("ItemName"));
}
res.close();
c.close();
}
catch(Exception e)
{
e.printStackTrace();
}
return listacods;
}
}
Claro que importando sus respectivas clases
Código PHP:
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ConsCod conscod = new ConsCod();
String descuno = request.getParameter("Desc");
conscod.setDescuno(descuno);
ConsCodDAO conscoddao = new ConsCodDAO();
conscoddao.Consultar(conscod);
request.getSession().setAttribute("sessionConscod",conscod);
response.sendRedirect("ConItem.jsp");
}
Por favor ayudenme me urge
Muchas gracias de antemano