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



Home Answers Viewqa Java-Beginners Searching with alphabetical order
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Ragini Shukla
Searching with alphabetical order
2 Answer(s)      6 years and 5 months ago
Posted in : Java Beginners



Advertisement
View Answers

August 11, 2008 at 3:28 PM


i think question is not much clear..
are the 2 buttons search and delete?

If so...
then the jsp page should be like
<%@ page import="java.sql.*" %>
<%! Connection con;
ResultSet rst;
Statement st;
String url="jdbc:db2://url/db:";

%>
<%
try
{
Class.forName("com.ibm.db2.jcc.DB2Driver");
con=DriverManager.getConnection(url,"user","pwd");
System.out.println("After Establishing connection");
}
catch(ClassNotFoundException e)
{
System.out.println("ERROR!1: "+e);

}
%>
<table>
<tr><td>NAME</td></tr>


<%
try
{

st=con.createStatement();
rst=st.executeQuery("select * from table where name='"+request.getAttribute("name")+"' order by name");
System.out.println("After select");
while(rst.next())
{System.out.println("inside while");%>

<tr><td> <%= rst.getString(2) %><br></td></tr>


<%} }

System.out.println("After reading values");

}

catch(Exception e)
{
System.out.println("ERROR!!2 :"+e);

}





%>






This is for displaying name in a jsp page....
similarly u can use the query delete * from table where name='"+request.getParameter("name")+"'"






i think this qould help u.......
Thanks and regards
prashu


August 11, 2008 at 3:30 PM


hai.........
aftr that please use
closing tags for table...

thanks and regards
prashu


Related Tutorials/Questions & Answers:
Searching with alphabetical order - Java Beginners
Searching with alphabetical order  Hi, I want to this please help me Steps:- 1:-I have a one form of name text box with two button. 2:-user input in name text box(alphabetical order)search all fields from
Searching with alphabetical order - Java Beginners
. 2:-User input in the name text box(searching alphabetical order) name...Searching with alphabetical order  Hi, please understood my problem and send write code its very urgent I a write once again. Steps
Advertisements
Alphabetical order - Java Beginners
clicked the view button Now i want to display the files in alphabetical order...Alphabetical order  Hi.. I've a swings application about adding a record into a file and displaying it in text area. It contains the fields... ID
Alphabetical order - Java Beginners
in alphabetical order of ID. How can i implement this... Pls Help..:) Thanks...Alphabetical order  Hi.. I've a swings application about adding a record into a file and displaying it in text area. It contains the fields... ID
Reverse word of string in alphabetical order
Reverse word of string in alphabetical order  wap a program that reverse word of string in alphabetical order. e.g. input by user The purpose of education is to replace an empty mind with an open one output
How to index a given paragraph in alphabetical order
How to index a given paragraph in alphabetical order  Write a java program to index a given paragraph. Paragraph should be obtained during runtime. The output should be the list of all the available indices. For example: Input
Arrange the sentences in alphabetical order of words Java
Arrange the sentences in alphabetical order of words In Java Program... the sentences in alphabetical order of words. Here is the code for sorting Sentence in Alphabetical order: import java.util.*; import java.util.regex.
order
order   write a java code to enter order of number of chocolates(bar,powder,giftbox) in arraylist. Also consider exceptional cases like entering integer in name use try,catch ,throw to deal with exception
searching books
searching books  how to write a code for searching books in a library through jsp
searching technique
searching technique  Hi, i need any searching technique in java to search the data and give the all possible data by links
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
file searching
file searching  i need a prog for searching inside a text file after evry 1 min to find does it hav any new entry
Read a string and reverse it and then print in alphabetical order.
Read a string and reverse it and then print in alphabetical order... String reverse(String str) method and set in alphabetical order by String... in alphabetical order. ReverseAlphabetical.java  
searching string
searching string   how to write a program for searching a string   Hi Friend, Try this: import java.util.*; class SearchString{ public static void main(String[] args){ Scanner input=new Scanner(System.in
searching the data
searching the data  respected sir , i am making the desktop application , so how can i search the data which are stored in the mysql databses through click the button and display in jtable through netbeans dynamically
Searching - Hibernate
'Sandeep' order by record.userid"; Query query = session.createQuery(SQL
searching inside a file for details
searching inside a file for details  i created a file with name,country,state etc...when i'm searching for the name, i have to get other details like country,state etc...please do help
Searching for Code - JSP-Servlet
JSP, Servlet Searching for Code  Hi, i am looking for a jsp servlet code examples for the search function in my application.Thanks
HQL order by.
HQL order by.  HQL Order by query giving problem.   Order... mention, order by automatically sorted the list in ascending order. Here is an example of order by clause. Since we didn?t mention ?asce? or ?desc? it will return
searching from database
searching from database  how to search data from data base throug search...such as contact no./lastname /firstname should give whole information from database...   Please visit the following link: Servlet search
SQL ORDER BY
SQL ORDER BY       The ORDER BY keyword sort the table result set by a specified column. You want to sort the records in ascending order,  you can use the ASC keyword
Searching an element - JSP-Servlet
Searching an element  Dear sir, sir i have an employee table... doing a searching an element by empId and displaying a all the employee table... for searching an element by the empId.and one submit button for submitting this form.And
Searching an element - JSP-Servlet
Searching an element  Dear sir, sir i have an employee... in that i am doing a searching an element by empId and displaying a all... field for searching an element by the empId.and one submit button for submitting
Java String searching.
Java String searching.  How to search a string in given String array?   import java.util.Scanner; public class StringSearch { public... and for searching we used userCity.equalsIgnoreCase(city[i
Java Sorting and Searching
Java Sorting and Searching   If anyone could help me with this I would be really thankful! Write a program that stores the names of these artists in a String array. The program should prompt the user to enter the name
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
Searching operation in JAva
Searching operation in JAva  Sir, I have made a project for the Dispatch section of my office. I have to search for letters that are dispatched on a particular date. Now there are thousands of letters dispatched on a particular
Searching English words in a string
Searching English words in a string  My task is to find English words and separate them from a string with concatenated words..for example AhdgdjHOWAREgshshYOUshdhfh I need to find if there exists any English words.   
Advertisements
 

 

 

DMCA.com