logic-iterate
in my code i am using for-each loop for displaying data i want use tag to display data how to use plase help me
<%@ page import="java.sql.*" %>
<%String[] id = (String[])session.getAttribute("ids"); %>
<%try{ %>
<% Class.forName("oracle.jdbc.driver.OracleDriver"); %>
<HTML>
<head>
</head>
<BODY BGCOLOR="baba21">
<table>
<tr>
<th><h4>UserName:<%=session.getAttribute("username")%></h4></th>
<th align="right"colspan="200"><a href="logout.jsp">Logout</a></th>
</tr>
</table>
<H1 align="center">MyCart</H1>
<form action="logout.jsp">
<%!
Connection connection=null;
%>
<%
connection = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:xe","bms","abc");
Statement statement = connection.createStatement() ;
%>
<TABLE BORDER="1"align="center">
<TR>
<TH>Selected Books</TH>
</TR>
<%
for(String i : id){
ResultSet rs = statement.executeQuery("select * from books where bookname='"+i+"'") ;
%>
<% while(rs.next()){%>
<TR>
<td><%=rs.getString(1)%></td>
</TR>
<% } } %>
<%}catch(Exception e){ } %>
</TABLE>
<%
try{
String name=(String)session.getAttribute("username");
for(String i : id){
PreparedStatement ps=connection.prepareStatement("insert into buy values(?,?)");
ps.setString(1,name);
ps.setString(2,i);
ps.executeUpdate();
}
}
catch(Exception se){ }
%>
</form>
</BODY>
</HTML>
View Answers
Ads
Related Tutorials/Questions & Answers:
Logic Iterate.
Logic Iterate. I have one doubt about
logic:
iterate.
I use text feild inside of
logic:
iterate , there is possible will generate N no of rows (text feild) inside of
iterate. my doubt is how to get the Paritcular rows text
Logic Iterate.
Logic Iterate.
logic iterate Struts
I have one doubt about
logic:
iterate.
I use text field inside of
logic:
iterate , there is possible... the Particular rows text value.
for example:
print("<
logic:
iterate id="xid
Advertisements
Struts logic iterate
;
<body>
<h1> Search </h1>
<
logic:
iterate name...;tr>
<td align="center">
<
logic:
iterate name="listMs...Struts
logic iterate This is my jsp page in which i used 3
logic
logic-iterate
logic-iterate in my code i am using for-each loop for displaying data i want use tag to display data how to use plase help me
<%@ page import="java.sql.*" %>
<%String[] id = (String[])session.getAttribute("ids
i want to know how a slide will hide
i want to know how a slide will hide when im click on the button then im getting a slide, but when im click on the another button this slide will be hide.. and here im using
logic iterate to getting the values from action class
i want to know how a slide will hide
i want to know how a slide will hide when im click on the button then im getting a slide, but when im click on the another button this slide will be hide.. and here im using
logic iterate to getting the values from action class
jsp page to Showuser details
;Last Name</b></td>
</tr>
<
logic:
iterate id..." prefix="
logic" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>...;
</tr>
</
logic:iterate>
<tr>
Struts iteraor
;%@taglib uri="http://struts.apache.org/tags-
logic" prefix="
logic"%>
<html>...;body>
<h1> Search </h1>
<table> <tbody>
<
logic:
iterate name="listMsg" id="listMsgId">
<tr>
<bean:write name
struts validation
="multipleselect">
<
logic:
iterate id...;
<
logic:
iterate id="statusMasterBe...="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="
logic" %>
<
struts validation
="multipleselect">
<
logic:
iterate id...;
<
logic:
iterate id="statusMasterBe...="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="
logic" %>
<
how can i hide and show tables
;
<
logic:present name="list">
<
logic:
iterate id...="totZoneRecord">
<
logic:
iterate id="ZoneRecord" name="totZoneRecord...;
<
logic:
iterate id="TerritoryRecord" name="listTerr">