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



Home Answers Viewqa JSP-Servlet Passing value in hyperlink
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


yogita
Passing value in hyperlink
1 Answer(s)      6 years and 6 months ago
Posted in : JSP-Servlet


How to pass value in anchor tag or HTML link from one JSP page to another JSP page ?and how to retrieve values in another..., Retrive value from database Retrive data from database User


Advertisement
View Answers

April 18, 2008 at 7:16 PM


Hi friend,

<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<html>
<head>
<title>Retrive value from database</title>
</head>
<body>
<h2><font color="#CC3366">Retrive data from database</font></h2>
<table border="0" width="50%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<form method="POST">
<table border="1" width="100%" cellspacing="0" cellpadding="0" bgcolor="#FFE1E1">
<tr>
<td width="50%" valign="right"><b>User ID</b></td>
<td width="50%" valign="right"><b>First Name</b></td>
<td width="50%" valign="right"><b>Last Name</b></td>
<td width="50%" valign="right"><b>Qualification</b></td>
<td width="50%" valign="right"><b>Engineer</b></td>
<td width="50%" valign="right"><b>Docter</b></td>
<%
Connection con = null;
String url = "jdbc:mysql://localhost:3306/";;
String db = "register";
String driver = "com.mysql.jdbc.Driver";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,"root","root");
try{
Statement st = con.createStatement();
String query = "SELECT * FROM insert_retrive";
ResultSet rs = st.executeQuery(query);
while (rs.next()) {
%>
</tr>
<tr>
<td width="50%" valign="right"><%=rs.getInt("id")%></td>
<td width="50%" valign="right"><%=rs.getString("userid")%></td>
<td width="50%" valign="right"><%=rs.getString("lastname")%></td>
<td width="50%" valign="right"><%=rs.getString("qualification")%></td>
<td width="50%" valign="right"><%=rs.getString("engineer")%></td>
<td width="50%" valign="right"><%=rs.getString("docter")%></td>
</tr>
<%}
out.println("<br/><a href=Insert-and-Retrieve.jsp><b>Home</b></a>");
rs.close();
con.close();

}
catch (SQLException ex){
System.out.println("SQL statement is not executed!");
}
}
catch (Exception e){
e.printStackTrace();
}
%>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>

------------------------------------

read for more information.

http://www.roseindia.net/jsp/



Related Tutorials/Questions & Answers:
Passing value in hyperlink - JSP-Servlet
Passing value in hyperlink  How to pass value in anchor tag or HTML......, Retrive value from database Retrive data from database User   Hi...*,java.text.*" %><html><head><title>Retrive value from
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
Advertisements
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing values in hyperlink
passing values in hyperlink  Hi. I have given a hyperlink in one jsp page. Can i able to pass that hyperlink label as a value to the next page its navigating when the user clicks it. Plz respond me quickly. Thanks in advance
passing value of radio button
passing value of radio button  hi,i have 3 jframe built using the GUi editor in net beans 6.9. i have two radio button in the first jframe.i have to get the selected item appear on the 3rd frame after passing through the second
passing value from javascript popup
passing value from javascript popup  How to take user input and pass that input value using popup in Javascript
passing values between jsp file through hyperlink in div tag
passing values between jsp file through hyperlink in div tag  <...-lable"&gt; &lt;Select name="manager"&gt; &lt;option value="" selected&gt;Select&lt;/option&gt; &lt;option value="Ashok
hyperlink
hyperlink  I have a .xls file and i want the code to open this .xls file in read only mode when i click on a hyperlink,it should not not be editable,please send me the code
use data from database table as hyperlink value - JSP-Servlet
to hyperlink. I want to use this data as hyperlink and use it as the value... as the hyperlink's value then pass to the next page and retrieve the complete details of the row...use data from database table as hyperlink value  I'm creating a web
passing value from javascript to jsp - JSP-Servlet
passing value from javascript to jsp  Hi... Is there any way to get the value from the javascript and print it on the current jsp page or print an array onto the current jsp page using javascript  Hi Friend, We
passing value fron script to scriplet - JSP-Servlet
passing value fron script to scriplet  how to pass value from Java..., or use a the name/value query string. your first should look something like: Enter you value here: Then click the button to Check you use
passing text value from pop up to parent page
passing text value from pop up to parent page  i want to pass value of a textbox of one pop up window to its parent page(html). that parent page contain a table. And i want to pass that text value to one cell in table of parent
Problem passing a value from one jsp to another using href
Problem passing a value from one jsp to another using href  first page.jsp <a href="common.jsp?param=<%l.get(k).parentname%>">...);%> since url print a common.jsp?param=Arts but attr return a null value
Problem passing a value from one jsp to another using href
Problem passing a value from one jsp to another using href  first page.jsp <a href="common.jsp?param=<%l.get(k).parentname%>">...);%> since url print a common.jsp?param=Arts but attr return a null value
enable hyperlink
enable hyperlink  How to enable hyperlink
use data from database as hyperlink and pass the data in the hyperlink
data as hyperlink and all the data links are passing the first parameter only. I...use data from database as hyperlink and pass the data in the hyperlink  Hi Friends, I am using the data from database as hyperlink and pass the data
passing textbox value from one page to another page using html n javascript
passing textbox value from one page to another page using html n javascript  on button onclick event pass text box value and i want to pass value...;/td> </tr> <tr> <td colspan=2><input type=submit value
Hyperlink on UILabel iPhone SDK
Hyperlink on UILabel iPhone SDK  Hi, I wanted to set a hyperlink on UILabel in my iPhone application. Can anyone suggest me how to do it? Thanks
Passing variable
Passing variable  How to pass variable to HTTP object in HTMl or PHP
eclips hyperlink - JSP-Servlet
eclips hyperlink  In my myeclipse if hyperlink is provided in any application , it's not working when I deploy it. I also use net at my PC, is there any problem due to IP Address
Call a servlet on click of hyperlink
Call a servlet on click of hyperlink  Call a servlet on click of hyperlink   . request.getContextPath() is used to return...; </head> <body> <h2>Click on bellow hyperlink
Passing array element
Passing array element  What about passing an element of an array? If I have array of objects and pass functionA(arr[2]); Then functionA() will get arr[2] as a value type or a reference type
Argument Passing
Passing Argument in Java  hi this is my code class Test { void meth(int i, int j) { i *= 2; j /= 2... and 20 as a result it multiply the value of a i.e 15 by 2 and divide the value
how to pass the mutiple values from <Ui:datagrid hyperlink - JSP-Servlet
how to pass the mutiple values from    I am getting the error when passing the values from this way emp2=${employee.lastName1} & name=${employee.firstName.How to pass the values from hyperlink in column
passing values on button click
passing values on button click  Please help me to solve this issue.I want to pass a value assigned to button to another view upon button click in xcode
Creating Hyperlink using GWT
Creating Hyperlink using GWT       This example describes the Basics for building the Hyperlink using GWT. The steps involved in Building the Hyperlink are described below
Use of Hyperlink in Swing - Swing AWT
Use of Hyperlink in Swing  Hi, We are developing the UI using the Java Swing and I have to create Hyperlink in the JTable cell so that if the user click on the Hyperlink it will open other window/screen/panel. My Question
Argument Passing
, the method takes the arguments 15 and 20 as a result it multiply the value of a i.e 15 by 2 and divide the value of b 20 by 2 to produce the output 30 and 10
 

 

 

DMCA.com