how to make seperate view count for each row while clicking view button

how to make seperate view count for each row while clicking view button

I am getting problem with view count when i click view button the seperate count should be happen for each row

here is my code

**

Tabledata.jsp

<%@page import="java.sql.DriverManager"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.Statement"%> <%@page import="java.sql.Connection"%>



Resolved Queries

<% HttpSession session1=request.getSession(); String ch = session1.getAttribute("category").toString(); System.out.println(ch); String ss="null"; Connection con = null; String url = "jdbc:db2://localhost:50000/"; String db = "SMILEFRM"; String driver = "com.ibm.db2.jcc.DB2Driver"; String userName ="db2admin"; String password="db2admin"; int sumcount=0; Statement st; try{ Class.forName(driver).newInstance(); con = DriverManager.getConnection(url+db,userName,password); String query = "select * from db2admin.querydetail where category='"+ch+"' and answer!='"+ss+"' "; st = con.createStatement(); ResultSet rs = st.executeQuery(query); %> <% while(rs.next()){ %> <% } %> <% } catch(Exception e){ e.printStackTrace(); } %>
IDStateCategoryTitleQueryAnswerReference
<%=rs.getString(1)%> <%=rs.getString(2)%> <%=rs.getString(3)%> <%=rs.getString(4)%> <%=rs.getString(5)%> <%=rs.getString(6)%> <% try{ out.println((Integer)application.getAttribute("user") + 1); application.setAttribute("user",(Integer)application.getAttribute("user")+1); } catch(NullPointerException e) { application.setAttribute("user", new Integer(1)); out.println((Integer)application.getAttribute("user")); } %>

**

viewrow.jsp

<%@page language="java"%> <%@page import="java.sql.*"%>

<% String id=request.getParameter("id"); //String cat=request.getParameter("category"); //out.println(id); int sumcount=0; try { Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance(); Connection conn = DriverManager.getConnection("jdbc:db2://localhost:50000/SMILEFRM","db2admin","db2admin"); String query = "select * from db2admin.querydetail where cid='"+id+"'"; Statement st = conn.createStatement(); ResultSet rs = st.executeQuery(query); while(rs.next()){ %> <% //String ida=request.getParameter("id"); //String DbUserid=request.getParameter("id"); Integer hitsCount = (Integer)application.getAttribute("hitCounter"); if( hitsCount ==null || hitsCount == 0 ){ /* First visit */ out.println(" "); hitsCount = 1; }else{ /* return visit */ out.println(" "); hitsCount += 1; } application.setAttribute("hitCounter", hitsCount); %>

Number of views: <%= hitsCount%>

<% } } catch(Exception e){} %>

** **

View Answers









Related Tutorials/Questions & Answers:
how to make seperate view count for each row while clicking view button
how to make seperate view count for each row while clicking view button  I am getting problem with view count when i click view button the seperate count should be happen for each row here is my code ** Tabledata.jsp <
Delete and add row from Table View iPhone
Delete and add row from Table View iPhone In this tutorial will learn how to delete and also how to add row into the table view iPhone, with the help of edit... of items (or rows) that may be divided into sections. Each row may display strings
Advertisements
How to send and view data in seperate tables of a swing application, to a japser reporting(two)
How to send and view data in seperate tables of a swing application... to view and get printed them in a jasper report. In the jasper report.... and this has been coded for a button action performed) try{ JRTableModelDataSource
How to send and view data in seperate tables of a swing application, to a japser reporting(two)
How to send and view data in seperate tables of a swing application... to view and get printed them in a jasper report. In the jasper report.... and this has been coded for a button action performed) try{ JRTableModelDataSource
iphone button change view
previous view on clicking back button ADS_TO_REPLACE_9 -(IBAction... iphone button change view Final application will look like... change view i.e. when button is clicked will move to next view. This application
How to Manipulate List to String and print in seperate row
How to Manipulate List to String and print in seperate row  I am... header row BufferedWriter out = new BufferedWriter(new FileWriter(filename...) { while ( it.hasNext() ) { //Get link and create object
Adding button to each row for the table and adding row to another table
Adding button to each row for the table and adding row to another table  Hi I need to add button to each line in the table(Table data is retrived... row of the table
view
view  what is the use view in database
JSP view detail page on accept button click
JSP view detail page on accept button click  i Have 1 jsp page in that there r 2 button accept and view details when we click on aceept button it will submit to next page and when click on view details page it will shown the data
getting radio button at start of each row of table - Struts
getting radio button at start of each row of table  i have done the following things, and this is fine for me. But i want radio button at the place... at the start of each row as u saw in above output. So what should i have to do
How to read and retrieve jtable row values into jtextfield on clicking at particular row ...
How to read and retrieve jtable row values into jtextfield on clicking at particular row ...  Hello Sir, I am developing a desktop... to read all the values of particular row at which mouse is clicked. and display
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers  how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
How to Extract row from table view using JSP Code - Java Beginners
How to Extract row from table view using JSP Code  Hi Friends... problem exist with retrival of row from a table on click of link. Table Structure... Email 1 A B C D E F G Update Delete On click of Update, entire row
iphone Table View
iphone Table View In this tutorial will learn how to use Table View and also how to add object to table view, will add or insert the object into the Table.... Each row may display strings, images, or other identifiers of the represented
Ask make graph from i report and view to java Language Programming
Ask make graph from i report and view to java Language Programming  Dear sir, Please help me, i want to make a graph from mysql to i report and view to java. Please help me, give me example source code please. thank you
iPhone Picker Object On Toolbar Button
iPhone Picker Object On Toolbar Button In this tutorial will learn how to use Picker view, also the Toolbar and on that will place Toolbar button and the selected object in Picker view can be seen on Tool bar button. Here Picker view
How to make a button of different behaviour?
How to make a button of different behaviour?  Suppose In a jsp page I have a button SAVE with id="btnSave" value="SAVE" and a javascript function... of SAVE button will call ajaxInsertUpdateData(document.getElementByID("btnSave
Count Row - JSP-Servlet
Count Row  Hello all, Please I need your help on how to desplay the number of row(s) affected along with the affected row(s) in mssql database 2000..."); while (res.next()){ count = res.getInt(1); } out.println
JDBC Get Row Count
in JDBC Get Row Count. The code help you to understand how to count the number... JDBC Get Row Count       The JDBC Get Row Count enables you to return the row count of a query. JDBC Get Row
How to map MySQL View and Hibernate framework
How to map MySQL View and Hibernate framework  I found the following while trying to access MySQL View via Hibernate. HTTP Status 500 - java.lang.NoSuchMethodError: org.hibernate.hql.antlr.HqlBaseParser.recover(Lantlr
How to map MySQL View and Hibernate framework
How to map MySQL View and Hibernate framework  I found the following while trying to access MySQL View via Hibernate. HTTP Status 500 - java.lang.NoSuchMethodError: org.hibernate.hql.antlr.HqlBaseParser.recover(Lantlr
iPhone Multiple View
into the classes file. Then in each view controller file will write the code for button..., when you press button will take you to another view and also the button type... the view whenever the button is clicked and in ViewDidLoad will fix first view
What is View?
), except for the fact that the real tables store data, while the views don?t. The view...What is View?  What is View?   Hi, A SQL View is a virtual table, which is based on SQL SELECT query. Essentially a view is very close
how to make enable/disable textbox in while(rs.next)
how to make enable/disable textbox in while(rs.next)  Hi, I'm trying to enable/disable the textbox in the while loop. It works but when i want.../disable function,the data are updated correctly. Is my javascript wrong? How do i
how to make enable/disable textbox in while(rs.next)
how to make enable/disable textbox in while(rs.next)  Hi, I'm trying to enable/disable the textbox in the while loop. It works but when i want.../disable function,the data are updated correctly. Is my javascript wrong? How do i
Table view with multiple view and sections
in Table View and will have Back button on next view so that we can come back... of section into the table view, number of section is counted by return [Items count... Table view with multiple view and sections Project will look like
how to display the values of one list in other upon clicking a button in struts2
how to display the values of one list in other upon clicking a button in struts2  Hello friends..Am new to struts2..Please any one has to guide me... list upon clicking a button...Can any one provide me the sample code.. Hope
how to make authentication for each user using jsp/servlet?
how to make authentication for each user using jsp/servlet?  i have 10 jsp pages and 5 users.I use 10 buttons for open the page.Admin assign some jsp pages to each user.If admin assign page1 and page2 for user1 then make other
How to Create Custom Picker View in iPhone
How to Create Custom Picker View in iPhone  Hi, How to create custom picker view application using iphone. Can anybody tips or online help guide about this topic. Thanks
Count instances of each word
Count instances of each word  I am working on a Java Project that reads a text file from the command line and outputs an alphabetical listing of the words preceded by the occurrence count. My program compiles and runs
Insert specific fields into table dynamically for each row.
insert there for each row and for each row there is a button "done".if he click on done the values will be inserted into database.Then he enter values for next row...Insert specific fields into table dynamically for each row.  
how to access the object of one frame on clicking a button without using this keyword
how to access the object of one frame on clicking a button without using... extends Frame { public static void main(String args[]) { Button b1... Button("Yellow"); mb.add(b1); mb.add(b2); mb.add(b3
Insert specific fields into table dynamically for each row.
insert there for each row and for each row there is a button "done".if he click on done the values will be inserted into database.Then he enter values for next row...Insert specific fields into table dynamically for each row.  
Simple Table View With Next View
Simple Table View With Next View In this iphone tutorial will learn how to use Table View and also how to add object to table view, to insert the object into the table view we have to take an array and through that will add or insert
adding view to viewcontroller
adding view to viewcontroller  How to add a frame window that opens on button click .. in iPhone application
How to search the selected item in row table using radia button in JSP?
How to search the selected item in row table using radia button in JSP?  How to search the selected item in row table using radia button in JSP
tree view
tree view  display a tree view in flex?nodes will be in the form
RMS & View
RMS & View  DIffrence between RMS & VIEW
How to view a list of MySQL users and their privileges?
How to view a list of MySQL users and their privileges?  Hi, How to view a list of MySQL users and their privileges? It want to view these two... command to view list of users and their privileges in MySQL database. If you have
Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below
the table rows up to view more underlying data, then, the table's header (1st row...Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below  HI, I have
iOS View
iOS View   What is the Difference between View's bounds and frame in iOS?   Difference between View's bounds and frame in iOS The frame of a view is the rectangle, expressed as a location (x,y) and size (width,height
How to view database for user when they login in netbeans and mysql?
How to view database for user when they login in netbeans and mysql?  ... they click the button submit, the next page they going to see is the information they just fill in to make them be able to print it. I have try some code
Character count by while loop
Character count by while loop  Write the program to count the number...]; int count=0; for ( int i=0; i<third.length; i++){ if (ch==third[i]) count++; } boolean flag=false; for(int j=counter-1;j>=0;j--){ if(ch==third[j
How to delete the row from the Database by using while loop in servlet
How to delete the row from the Database by using while loop in servlet ... details. While loop is not terminate, in while loop why If condition...(); while(rs.next()) { dbn=rs.getString("users
How to Display Next question from database after clicking Next Button using "Arraylist concept"
How to Display Next question from database after clicking Next Button using... = 0, count=1; String answer...;&nbsp;Sorry!No Question to view.</font> <
Toggle hide/show by clicking same button
Toggle hide/show by clicking same button In this tutorial, we will discuss about how to toggle hide/show by clicking button. In the given below 2 example, there is button ,by clicking on it, the paragraph will hide/show . In first
How to identify the radio button id and row id in a table in jsp?
How to identify the radio button id and row id in a table in jsp?  ...; var row = table.insertRow(rowCount); var... = false; } Make TypeBranch UPS ATM UPS Under
How to make animated web button, make animated web button, animated web button
How to make animated web button       This is a web button animation example, it is a very simple to make with this example. I hope you will like it so follow now. New File: First
View jsp
View jsp  <%@ page language="java" contentType="text/html; charset...; charset=ISO-8859-1"> <title>View ur Details</title> </head>...;%=request.getContextPath()%>/Controller"> <input type="hidden" name="page" value="view
previous view controller
previous view controller  How to get back to the previous view... manages the push and pop functionality ..and it itself creates the Back Button to go back to the previous view controller. See the example given below

Ads