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



Home Answers Viewqa JSP-Interview-Questions ID using get the databse latest value and displayed in jsp
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Gowrishankar
ID using get the databse latest value and displayed in jsp
0 Answer(s)      3 years and 7 months ago
Posted in : JSP-Interview Questions


function getRecord(){
    var id=document.form.id.value;
    alert(id);
    var f=document.form;
    f.method="post";
    f.action='preview.jsp?id='+id;
    f.submit();
}
<body id="page1" onload="getRecord();">
<form>
<%
String id=request.getParameter("id");
int no=Integer.parseInt(id);
int sumcount=0;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/TEst", "root", "root");
//String query = "select * from Data where id='"+no+"'";
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(query);
while(rs.next()){
%>
<b>Start Date    :</b>> <%=rs.getString("start_date")%>
<b>Start Time    :</b>  <%=rs.getString("start_time")%> 
<b>End Date      :</b> <%=rs.getString("end_time")%>

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

I have done jsp page like this ....  I want to get the latest value using id and displayed in that start date end date etc,... How to get latest values in my jsp page and  id will be shown in url also?

Advertisement
View Answers

Related Tutorials/Questions & Answers:
ID using get the databse latest value and displayed in jsp
ID using get the databse latest value and displayed in jsp   I have... in the form (it means latest values) ... how to retrive that values using ID and displayed in preview.jsp page . so technically pass the new id and display the values
ID using get the databse latest value and displayed in jsp
ID using get the databse latest value and displayed in jsp  function... want to get the latest value using id and displayed in that start date end date etc,... How to get latest values in my jsp page and id will be shown in url
Advertisements
Retrieve data from databse using where in JSP
Retrieve data from databse using where in JSP  Hi, can somebody help me? I have a jsp page. in that i want to get data from the database where username is matched. i tried it. but can't get the output. here is the code. please
how to create a bar chart in jsp by fetching value from oracle databse?
how to create a bar chart in jsp by fetching value from oracle databse?  i want to show the population of various states in a bar chart in my jsp page by fetching the data from my oracle table. i am using my eclipse as my IDE
How many ways can we get the value of current session id?
How many ways can we get the value of current session id?  How many ways can we get the value of current session id
How to get an Id vaue - JSP-Servlet
How to get an Id vaue  Dear Sir, Thanks for posting... or delete etc button i have to go that page and i want that selected id value... a respected cases.In that case i am calling a jsp by using a response.sendRedirect
Get the error messages displayed
Get the error messages displayed  How to get the error messages displayed
How to get an Id vaue - JSP-Servlet
How to get an Id vaue  Dear Sir , How to get an Id value of a column when it is select ,i have to get an perticular rows Id value .I have... row i have to get a particular rows Id value.how to do this sir .I done
How to get Button Id ?
How to get Button Id ?  How to get Button ID instead of its value in Servlet. (I am not using jsp right now
how to get the checkbox value in jsp
how to get the checkbox value in jsp  how to get the checkbox value in jsp?   JSP CheckBox Example - how to get the checkbox value in jsp
sorting and filtering the displayed table data using jsp and xml
sorting and filtering the displayed table data using jsp and xml  I have created a xml file and a jsp file, which uses DOM parser to display... that is displayed in web page. How to do it ??? Please help as soon as possible
Read Excel data using JSP and update MySQL databse
Read Excel data using JSP and update MySQL databse  HOw to read excel data using JSP and update MySQl database
Finding MAX value from emp_id column using SQL query?
Finding MAX value from emp_id column using SQL query?  I need to select maximum of the Emp_id values from SQL server 2005 table.I was using... of emp id from the table.(Actually it picks up Max value using by looking at 1st
Getting the last inserted id using jsp
Getting the last inserted id using jsp  Pls how can i retrieve the last inserted id after submitting a form to mysql using jsp
get a radio button click value - JSP-Servlet
servlet from another jsp i.e 'main.jsp', then you have to store the value of id... have one probs that is i m getting a null value i m calling getParameter("id... to retrieve value of id: String id=request.getParameter("idvalue"); Hope
add text box and select list dynamically and get its value to store it into database using jsp request parameter
add text box and select list dynamically and get its value to store it into database using jsp request parameter  its very helpful when you have only dynamically added text field but want code to retrive value of dynamically
get value from multiple textbox in jsp
get value from multiple textbox in jsp  how to get multiple textbox value in another jsp? If i using the following code <%for(int i=0;i<3;i++) {%> <td>name<input type="text" class="name" id="name">
how to print data(From databse Oracle10g) in preformatted A4 and A3 paper using jsp
how to print data(From databse Oracle10g) in preformatted A4 and A3 paper using jsp  how to print data(From databse Oracle10g) in preformatted A4 and A3 paper using jsp. I am inserting analysis report into a database using
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.  I am using postgresql-8.4.4-1-windows as database, jboss-4.0.5.GA as server and jdk-6-windows-i586 with IDE
Get form value in same page - JSP-Servlet
Get form value in same page  Hello friends, Can we get a form field value in the same to be processed in java coding... friend, For solving the problem visit to : http://roseindia.net/jsp/user
session value not get in many jsp page.
session value not get in many jsp page.  I am using servlet to set...,response); and get session value on jsp page by follwing:- String user=(String)session.getAttribute("user"); this is work but when this code is use in other jsp
jsp :how to edit table of data displayed using jsp when clicked on edit button
jsp :how to edit table of data displayed using jsp when clicked on edit button  i have a jsp program which displays data in the form of table ..now i...;"></td> <td><input type="hidden" name="id" value="<
how to get HTTP GET request value using javascript
how to get HTTP GET request value using javascript  how to get HTTP GET request value using javascript   how is how you can get HTTP GET request value using javascript: var parameter = window.location.search.replace
how to get combo box value - JSP-Servlet
the id in servlet page, that i have associated with value i.e "> bcoz i hav to store that id in database. how to get that value???   Hi Friend...how to get combo box value  i have created 1 servlet & 1 jsp page
list to be displayed in jsp page.
list to be displayed in jsp page.  Can any one help me? Am developing the code in struts.I have a list in action class that has to be printed in the dropdownlist in another jsp page.Please help me in the code.. Thank u
How to save and get value from JSP
How to save and get value from JSP  Employee Name Time... 324 2012-12-12 save i want to save dis value jsp to action ...how can i get all value ..and store..how can its values goes
jsp :how to edit table of data displayed using jsp when clicked on edit button
jsp :how to edit table of data displayed using jsp when clicked on edit button  i have a jsp program which displays data in the form of table ..now i want to delete this information in table when click on delete button and save
how to show effect (visual) on jsp page using value from database
how to show effect (visual) on jsp page using value from database  I am making a ticket booking system. I have a databse with a clumn "booking status... as seats should be displayed red. when the value in booking status
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp?  For example, In Employee.jsp form, When i click employee id value in combo box ,the related employee name will be displayed in text field
get a value when a radio button clicked - JSP-Servlet
get a value when a radio button clicked  sorry sir my actual probs is that 1st i m callig a jsp in that i m displaying a table where i used a radio button to access a value(also used u r code),then in this jsp i m having a forms
core java project by using databse
core java project by using databse  hello sir, i'm a b.tech final year student.... i wantto make a project on java with database... can u plzz suggest me how i can start for it.... means on which topic i can make project
 

 

 

DMCA.com