November 17, 2008 at 3:40 AM
Display record
<%@ page language="java" import="java.io.*, java.sql.*" %>
<html>
<head>
<title>display data</title>
</head>
<body>
<center>
<H1>Display Record From Database<H1>
<br>
<table border="1" cellpadding="0" cellspacing="0" width="500px" height="69">
<tr>
<td></td>
</tr>
<tr>
<td><b>Id<b></td>
<td><b>Name<b></td>
<td><b>Last Name<b></td>
<td><b>Delete<b></td>
</tr>
<%
Connection con = null;
String url = "jdbc:
mysql://192.168.10.211:3306/";;
String db = "amar";
String driver = "com.mysql.jdbc.Driver";
String username = "amar";
String password = "amar123";
try{
Class.forName(driver);
con = DriverManager.getConnection(url+db,username,password);
try{
Statement st = con.createStatement();
String sqlQuery = "Select * from userinform";
ResultSet rs = st.executeQuery(sqlQuery);
int sno = 0;
while(rs.next()){
sno++;
%>
<tr style="background-color:#CCFFFF;">
<td><%=sno%></td>
<td><%=rs.getString("name")%></td>
<td><%=rs.getString("lsname")%></td>
<td><a href = "deleteAction.jsp?id=<%=rs.getInt("id")%>">Delete</a></td>
</tr>
<%
}
rs.close();
con.close();
st.close();
}
catch(SQLException ex){
System.out.println("SQL satatment not found");
}
}
catch(Exception e){
e.printStackTrace();
}
%>
</table>
<a href="userInform.jsp">Home Page</a>
</center>
</body>
</html>
Related Tutorials/Questions & Answers:
java program for writing xml file - Java Beginnersjava
program for
writing xml file Good morning
i want to write values from my database(one table)into one xml
file.
Like
i have 3 coloumns in my table along with their values,so when click some button
i need to generate one
Advertisements
written in jsp filewritten in jsp file how to create and write in a jsp
file through simple core java code
Adding .txt files in a given directoryAdding .txt
files in a given directory
I want to read number of XML... tag value as one .txt
file in a given directory?
I have extracted tag values but plz help me how can
I save each body tag as one .txt
file and add in a directory
Reading and Writing files - Java Beginners to investigate
writing to
files a little (can be also done using Properties...Reading and
Writing files Hello,
please help me to Develop a simple... from a
file. After welcoming the users, ask them for their name and save
File saving and Writing File saving and
Writing Hello Rose india.....
I have a doubt... a "
file create option"
it will be ".csv"
file and
i want to write the data from arraylist into .csv
file
and
i want to save that
file so it will ask for "save
writing program - Java Beginnerswriting program WAP to input Name of Cricketer, Number of matches...;
for(int
i=0;i<5;
i++){
System.out.println("Enter cricketer name...: ");
int runs=input.nextInt();
average=runs/matches;
data[
i writing angularjs hello world programwriting angularjs hello world program Hi,
I just started to learn... tutorials.
I want to make simple
program and thinking to start from the Hello World
program in AngularJS.
Searching for simple example for
writing angularjs
Writing a GUI program - Java BeginnersWriting a GUI program Hello everyone!
I'm trying to write a
program... if that number is prime or not. When the second button is pressed the
program has to calculate the prime factors of the given number.
I figure out the
whole Writing and Reading A File (FirstName, LastName, Age).
I also made an empty
file I named "contactsFile.txt" where...
Writing and Reading A File Hello, I've been trying to learn
writing and reading data from
file for our assignment, but just stuck on how to proceed
writing and appending to a filewriting and appending to a file My input
file includes data from... and values and writes into an existing
file for 'male'. How can
I do the same for females and write into a different 'female string' in the same
program?
Sorry If
I File Writing - Java BeginnersFile Writing Hi...
I need a syntax or logic or
program by which we can write into the desired shell of the Excel
file from console window... Hi friend,
I am sending you a link. This is will help you. Please
writing program in bluej - Java Beginnerswriting program in bluej How to write the
program on follwing
WAP to inpout a string and print
Input :
I stidied Hard
Hi Friend,
Try the following:
import java.util.*;
public class UserInput{
public
Adding a text file - Java BeginnersAdding a text file Hello,
I need a
program that will search a text
file of strings representing numbers of type int and will write the largest and the smallest numbers to the screen. The
file contains nothing but strings
File I/O();
File[]
files = file.listFiles(filter);
for (int
i = 0;
i <... all the
files to on
file what am looking for is
writing files to different
files...
File I/O greetings
i was running into a problem. is their a way
Need help writing a console programNeed help
writing a console program
I need help cant seems to figure it out!
Write a
program that consists of three classes. The first class... will replace all sequences of 2 spaces with 1 space.
The
program will read a
file Writing Log Records to a Log File are
written into the given
file.
Here is the code of
program...
Writing Log Records to a Log
File
... and
severe that have log records. Log records are
written into a log
file Writing a file using servlets - JSP-Servlet, but its not
writing in the xyz.txt
file.
I think
writing in a servlet should...
Writing a
file using servlets I'm using a servlet to read an input... reading the data and creating a
file in my space. but it is not
writing Writing xml file - Java BeginnersWriting xml file Thank you for the quick response
The values which... values from the database.
If it is still confusing i'l post you my question
again... XmlServlet().createXmlTree(doc);
System.out.println("Xml
File Created
File I/OFile I/O
i am trying to write a
program that reads a text
file... the text
file then read it and write it into as a comma delimitade
file.
i have to problem:
everything is perfect but when it comes to
writing my
program also
Writing to and reading from a binary file in java.Writing to and reading from a binary
file in java.
I have
written... the binary
file from another
program as follows:
m_dis = new DataInputStream... having the format:
00501 40.815400 -73.045600.
The entries
I get in the binary
file Converting Text Files into Bzip FileConverting Text
Files into Bzip File Hi,
I am facing the problem during run the
program, when converting text
files into Bzip
file. Please guide me how do
i convert the text
file into bzip
file in PHP.
I will welcome, if anyone
File Upload and Retrive filesFile Upload and Retrive files Can any body help me am getting an error in uploading
file. into mysql database....
thank's in advance
need help on writing a program. - Java BeginnersWriting first Java Program Hi,
I need help to write my first Java
Program other then Hello World! Thanks!! Hi Thanks for choosing roseIndia to get your query solved. check given link to see the solution of your Java
File I/OFile I/O
i am trying to read and write a
file. my
program works perfectly
i am using PrintWriter and BufferedReader. but my problem is that when... like this
input
file
blahblah
i am a computer
i am running windows
i am
File I/OFile I/O
i have a problem
i am trying to print on a new line every...
File file = new
File(inpath);//
files from the inpath
File[]
files = file.listFiles();//listFiles all
file in inpath dir
for (int
i = 0;
i <
File I/OFile I/O
i am trying to read and write a 54mb text
file from one directory to another.
I managed to do it perfectly using the examples
i was given... question is, is their away
i can read and write in the shortes time possible(in seconds
Java I\O fileJava
I\O file What is the difference between the
File and RandomAccessFile classes
file I/Ofile I/O Write a java class which it should do below
· Read the attached
file.
· Sorted out and writer it into another
file(sorted values).
· Also find the SECOND biggest number in the attached
file i am getting an error in adding a menu item to a menu. i am getting an error in
adding a menu item to a menu.
i am not able to execute the menu
program.
i am getting an error at menu.add(menuitem); it says add method is undefined for type menu. but as far as
i know that is only way
problem of writing to a local file ( JApplet ) - Appletproblem of
writing to a local
file ( JApplet ) Dear All,
I want to
program a guestbook using java applets but now
I have
problem of
writing to a
file from JApplet.
it is working without any problem if
i run the
program using