use data from database table as hyperlink value

use data from database table as hyperlink value

View Answers

December 17, 2008 at 4:59 AM

Hi friend,

Code to help in Solving the problem :

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



<%

System.out.println("MySQL Connect Example.");
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";;
String dbName = "userdetails";
String driver = "com.mysql.jdbc.Driver";
String username = "root";
String userPassword = "root";


try {
Class.forName(driver).newInstance();

while(true)
{
conn = DriverManager.getConnection(url+dbName,username,userPassword);

Statement st = conn.createStatement();
String strQuery = "select * from transaction ";
// out.println(strQuery);

ResultSet rs = st.executeQuery(strQuery);

while(rs.next())
{
%>

<tr><td><a href="nextpage.jsp?code=<%=rs.getInt("code")%>>/td></tr>
<%
}

rs.close();
st.close();
conn.close();

}

}
catch(Exception e)
{
System.out.println(e);
}

%>

For more information on JSP visit to :

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

Thanks









Related Tutorials/Questions & Answers:
use data from database table as hyperlink value - JSP-Servlet
use data from database table as hyperlink value  I'm creating a web... 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 as hyperlink and pass the data in the hyperlink
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... and parameter value I wrote a logic to get it from the column data. The logic works
Advertisements
retrieve data from database with hyperlink
retrieve data from database with hyperlink  sir....i have one table called 'name' having two values i have to retrieve those data with a hyperlink and show in browser and if we click hyperlink its shows his sub categories....how
Retrieving value from multiple table in database
Retrieving value from multiple table in database  Hi fnds, I want to maintain the financial database of 20 users for 1 year and update the details... created 12 tables with table name - month1,month2,....,upto month12.. each table
Retrieve multiple data from database into Table.....
Retrieve multiple data from database into Table.....   hi........... I want to Retrieve multiple data from database into Table but i am not able to.... i am only able to retrieve one value not more than that. means in my
data insertion from xml file to database table
data insertion from xml file to database table  Hi all, I have data in the XML file. I need to insert it into table in the database using servlet. so please reply me . ThankYou
Select data from Table in Database
Select data from Table in Database   ... the selected data from table in database. The select query in the database retrieve... the table, from where the data is retrieve. Understand with Example
retrieve the data to text fields from database on clicking the value of combo box
retrieve the data to text fields from database on clicking the value of combo box   retrieve the data to text fields from database on clicking... getting data into textarea from database table by clicking on the button
display data from a table in Access Database in a HTML page
display data from a table in Access Database in a HTML page  how to display data from a table in Access Database in a HTML page in a Java Program
Connecting to Database from a hyperlink in JSP - JSP-Servlet
Connecting to Database from a hyperlink in JSP  How can I connect to database by clicking on a hyperlink in a JSP Page.Can you please give me sample... which is connect to database using jdbc database
Dynamic retrieval od data from database and display it in the table at jsp
Dynamic retrieval od data from database and display it in the table at jsp ... the data from the mysql database... pls its urgent.. help me frnds....   Here is a jsp code that retrieves the data from the database and display
dynamic retrivel of data from mysql database in table format at jsp
dynamic retrivel of data from mysql database in table format at jsp  ... the data from database and display it as table format in jsp... For example, i have... of A1 should be retrived from database and display it in the respective textbox
how to display data from database according to entered value in search field
how to display data from database according to entered value in search...("SELECT M.MEMBER_ID, M.FNAME,M.LNAME,M.AGE,B.HEIGHT,B.WEIGHT, B.BMI_VALUE FROM...; <% String data=request.getParameter("bmi_value
how to fetch data from mysql database table and draw a bar chart on that data using in jsp
how to fetch data from mysql database table and draw a bar chart on that data using in jsp  how to create bar chart fetch data from mysql database using in jsp.please give me a right code. yhanks in advance
Subtract a value in the database from java
Subtract a value in the database from java   Hi, i want to know how to subtract a value on a database. im using JDBC connection from access and i want to decrement the value of table "quantity" of 1 each time it passes a loop my
Retrieve Value from Table - Hibernate
Retrieve Value from Table   Hai friend, I need help, How can i retrieve values From database using hibernate in web Application. As I new to hibernate I couldn't find solution for this problem.. Can anyone help please.. 
how to retrieve data from database using combobox value without using request.getParameter in jsp - JSP-Servlet
how to retrieve data from database using combobox value without using request.getParameter in jsp  Answer pl
how to use bean to retrieve data from database
how to use bean to retrieve data from database  how to use bean to retrieve data from database   poda sendru
How to display data fom MySQL DataBase-table in to JSP file by submitting a value in combobox.
How to display data fom MySQL DataBase-table in to JSP file by submitting a value in combobox.   I have the same problem.plz help me. I have MySQL DataBase/DB Name:lokesh; Table Name:TR_list; columns:nodename,packageno,TR
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I am getting the data's from the table that was stored in database. Now in the page in which i am getting all the data from the database has an another select
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I am getting the data's from the table that was stored in database. Now in the page in which i am getting all the data from the database has an another select
How to retrieve data from database by using combo box value in jsp? - JSP-Servlet
How to retrieve data from database by using combo box value in jsp?  Hello friend i want use only one jsp page.. but u give 2 pages... I want.... Your code here.. CREATE TABLE "user" ( "name" character varying(100
retrive data from database?
retrive data from database?  hellow i have a database sheet name as db1. it's contain sixty(60) sn,name ,rollno(primary key),father's name etc... from db1 and enter value in text box according there name,rollno and save
selecting data from database
selecting data from database  how to select data from database using Dao in struts   Hi, You have to load the data from database using hibernate and send the data in a Java file object to jsp page.ADS_TO_REPLACE_1
read value from database & alert it is available in database or not
read value from database & alert it is available in database or not  how to read value from text box and alert whether it is available in database...="text/javascript"> function check(value){ xmlHttp=GetXmlHttpObject() var
Fetch user records from a table in database
Fetch user records from a table in database  Hi. I have a field in database named stages. its datatype is varchar(60). It contains values chennai,trichy,kanchipuram for a single record. I have to retrieve these data from
How to Retrieve data from database in jsp
about how to fetch data from database table. We will give a simple example which will demonstrate you about fetching data from database table. Example We... tableName" for retrieving the data from database table and execute this query
retrive data from database
retrive data from database   hi.. i made a application form. it's have attribute s.no,name,roll no and i enter a few records. now i want to view all record not in database access sheet i want to view it at any another
Inserting Data In Database table using Statement
to insert the data in the database from our java program in the table stored... Inserting Data In Database table using Statement... of the PrintWriter class. We can insert the data in the database only and only
Get date data type from table
GET DATE DATA TYPE FROM TABLE In this example , we will get "Date" data type from a table of "Mysql" database and it also display...= st.executeQuery("select name,DOB from student where name ='Ankit'");             while
Retrieving the Image from a database Table
Retrieving the Image from a database Table Consider a case where we want... to retrieve the image from the database table. You can do it very easily after... from the database table our java program need to make a connection
Deleting Blob Data from Database table using servlet
Deleting Blob Data from Database table using servlet In this section, we will discuss about how to insert a blob data into a database table. A Blob stores a binary large object in the database table's row. Blob object
how to get multiple hyperlink values from a table column to another jsp file?
how to get multiple hyperlink values from a table column to another jsp file... for the user string in the database, as a result a table will come up with 3 columns itemid... show the specific details from that hyperlink which was clicked. there are 3
Retrieving Data from the table using PreparedStatement
to fetch the data from the database in the table from our java program using... Retrieving Data from the table using PreparedStatement... the getWriter() method of the PrintWriter class. We can retrieve the data from
Display Data from Database in JSP
Display Data from Database in JSP   ... and execute query to display data from the specified table.  Before.... This is first jsp page that has a link 'show data from table', user can show
Retrieving All Rows from a Database Table
from a database table. You know that table contains the data in rows and columns format. If you want to access the data from a table then you need to use some... data from a specific database table. If any exception occurs then shows a message
fetch data from database in javascript
fetch data from database in javascript   How to fetch data from database in JavaScript when it is a leap year
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
Use of Select Box to show the data from database
Use of Select Box to show the data from database   ... from database This example will describe you the use of Select Box in a JSP page to show the data fetched from the database. We are using Servlet to get data
I have to retrieve these data from the field table
I have to retrieve these data from the field table  Hi. I have a field in database named stages. its datatype is varchar(60). It contains values chennai,trichy,kanchipuram for a single record. I have to retrieve these data from
MYSQL retrieve record from Data table
MYSQL retrieve record from Data table  Hi. I have a field in database...,kanchipuram for a single record. I have to retrieve these data from the field table. Actually they are separated by comma. I want to take the values as single
Retrieving Data from the table using Statement
to fetch the data from the database in the table from our java program.  ... Retrieving Data from the table using Statement  ... of the PrintWriter class. We can retrieve the data from the database only and only
delete data from database - SQL
delete data from database  HOw to delete specific data from table> I want to delete one record from database. Thnx  Hi friend, -------------------------------------------- Visit for more information
How To Fetch Data From Database Into JTextArea
How To Fetch Data From Database Into JTextArea In this section we will read about how to get the data from database table into JTextArea.... The getOperation() method I have defined for fetching the data from database and set
retrieve data from mysql database
selected value on combobox which is to be retrieve the relevant data from mysql...retrieve data from mysql database  hi am not familiar in php.....even... is stored on testtable table. but i need one data alone. i don,t know where to ask
code for insert the value from jsp to access database
code for insert the value from jsp to access database  code for insert the value from jsp to access database
related retrieving value from oracle database
related retrieving value from oracle database  how we get the value from database in the given textbox

Ads