Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet how to make seperate view count for each row while clicking view button
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


vishalng
how to make seperate view count for each row while clicking view button
0 Answer(s)      5 months and 11 days ago
Posted in : JSP-Servlet


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){} %>

** **


Advertisement
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
view
view  what is the use view in database
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
iphone button change view
is used to move to previous view, to add ViewController on button will make.... my project name is button_image, view based application. Make changes... ]; }   // this is to show previous view on clicking back button
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
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
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
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
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
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 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
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
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
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
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
Table view with multiple view and sections
and will have Back button on next view so that we can come back to the previous... Table view with multiple view and sections Project will look like this :    In this tutorial we are going to add another view
iPhone Multiple View
. Then in each view controller file will write the code for button and the action to the button. Before that will add some codes to .m and .h file of view. ..., when you press button will take you to another view and also the button type
tree view
tree view  display a tree view in flex?nodes will be in the form
RMS & View
RMS & View  DIffrence between RMS & VIEW
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
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
iPhone Simple Table View
Simple Table View In this 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... that Table view Knows how many rows to be set into Table, will display the actual
adding view to viewcontroller
adding view to viewcontroller  How to add a frame window that opens on button click .. in iPhone application
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
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
Advertisements
 

 

 

DMCA.com