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

Ads









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 <
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
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 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
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 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 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
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
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
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
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
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
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 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
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 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
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
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
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.  
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.  
RMS & View
RMS & View  DIffrence between RMS & VIEW
tree view
tree view  display a tree view in flex?nodes will be in the form
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
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
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

Ads