tengo el sig html que lo q hace es q el usuario elija alguna clave del servicio q requiere y la cantidad del mismo:
Código HTML:
Ver original
<table width="704" height="322" border="0"> <tr> </tr> <tr> </tr> <tr> <input name="clave" type="checkbox" id="clave" value="1"> BONO POR 10 HRS. <input name="cantidad" type="text" id="cantidad"> </tr> <tr> <input name="clave" type="checkbox" id="clave" value="2"> <input name="cantidad" type="text" id="cantidad"> </tr> <tr> <input name="clave" type="checkbox" id="clave" value="3"> <input name="cantidad" type="text" id="cantidad"> </tr> <tr> <input name="clave" type="checkbox" id="clave" value="4"> <input name="cantidad" type="text" id="cantidad"> </tr> <tr> <input name="clave" type="checkbox" id="clave" value="5"> <input name="cantidad" type="text" id="cantidad"> </tr> <tr> </p> </tr> </table>
q a su vez manda los datos a mi jsp q busca las claves seleccionadas y recupera el concepto o titulo del servicio, y su precio. lo q necesito es saber como le puedo hacer para multiplicar la cantidad enviada del html por el precio recuperado del jsp????????? estoy en blanco con esto de java porfis ayudenme
Código:
<%
Connection canal = null;
ResultSet tabla= null;
Statement instruccion=null;
String sitiobase = "c:/c/material.mdb";
String strcon= "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + sitiobase;
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
canal=DriverManager.getConnection(strcon);
instruccion = canal.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
} catch(java.lang.ClassNotFoundException e){} catch(SQLException e) {};
String SQLString = "SELECT TOP 10 * FROM conceptos";
if (request.getParameterValues("clave").length > 0 ) {
SQLString = "SELECT * FROM conceptos WHERE clave IN (";
for (String s : request.getParameterValues("clave")) {
SQLString += "\'" + s + "\', ";
}
SQLString = SQLString.substring(0, SQLString.lastIndexOf(',')) + ")";
}
try { tabla = instruccion.executeQuery(SQLString);
while (tabla.next()) {
out.println("CLAVE: <INPUT TYPE=TEXT NAME=clave VALUE="+ tabla.getString(1)+ "><BR><BR>");
out.println("TITULO: <INPUT TYPE=TEXT NAME=TITULO VALUE= '"+ tabla.getString(2)+ "'SIZE='100'><BR><BR>");
out.println("PRECIO: <INPUT TYPE=TEXT NAME=PRECIO VALUE= "+ tabla.getString(3)+ "><BR><BR>");
}
tabla.close();instruccion.close();canal.close();
} catch(SQLException e) {out.print(e);} catch(Exception ex){};
%>


