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



Home Answers Viewqa JSP-Servlet can u plz explain the http request methods
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


rkr
can u plz explain the http request methods
1 Answer(s)      5 years and 10 months ago
Posted in : JSP-Servlet



Advertisement
View Answers

March 9, 2009 at 2:36 AM


Hi friend,

public interface HttpServletRequest
extends ServletRequest
Extends the ServletRequest interface to provide request information for HTTP servlets.
The servlet container creates an HttpServletRequest object and passes it as an argument
to the servlet's service methods (doGet, doPost, etc).


Remove duplicate record :

MySQL remove duplicate

To remove duplicate entries in the MySQL database we can follow one of these following approach:

First approach is that we have to write three manual steps to create
the new backup table with unique entries then we will remove the older table and at
last we will rename the backup table with the same name of the older table that we have deleted.
Here is the explanation with the query :

To explain use we have to create a table which consists duplicate entries :
Query

CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(50) default NULL,
`password` varchar(50) default NULL,
`email` varchar(50) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `users` */

insert into `users`(`id`,`username`,`password`,`email`)
values (1,'Ankur','ankur','ankur@yahoo.com'),
(2,'Sam','sam','sam@yahoo.com'),
(3,'Xavior','xavior','xav@yahoo.com'),
(1,'Suman','suman','suman@one.com');

select * from users;

Output

+----+----------+----------+-----------------+
| id | username | password | email |
+----+----------+----------+-----------------+
| 1 | Ankur | ankur | ankur@yahoo.com |
| 2 | Sam | sam | sam@yahoo.com |
| 3 | Xavior | xavior | xav@yahoo.com |
| 1 | Suman | suman | suman@one.com |
+----+----------+----------+-----------------+
4 rows in set (0.00 sec)

Now to remove duplicate entries we can execute following query:
Query

CREATE TABLE backup_table AS
SELECT * FROM users WHERE 1 GROUP BY id ;
DROP TABLE users;
RENAME TABLE backup_table TO users;

Output

+----+----------+----------+-----------------+
| id | username | password | email |
+----+----------+----------+-----------------+
| 1 | Ankur | ankur | ankur@yahoo.com |
| 2 | Sam | sam | sam@yahoo.com |
| 3 | Xavior | xavior | xav@yahoo.com |
+----+----------+----------+-----------------+

Second approach to remove duplicate entries from the database table is
very simple and is extremely quick way to remove duplicates. Here is the query :
Query

ALTER IGNORE TABLE users ADD UNIQUE INDEX(id);

Output

+----+----------+----------+-----------------+
| id | username | password | email |
+----+----------+----------+-----------------+
| 1 | Ankur | ankur | ankur@yahoo.com |
| 2 | Sam | sam | sam@yahoo.com |
| 3 | Xavior | xavior | xav@yahoo.com |
+----+----------+----------+-----------------+

In the above query we have added unique index for id.


Related Tutorials/Questions & Answers:
can u plz explain the http request methods - JSP-Servlet
can u plz explain the http request methods  can u plz explain http request methods? as well in jdbc...how to delete the duplicate records in database... ServletRequest Extends the ServletRequest interface to provide request information
Can u Look to the error plz - Java Beginners
Can u Look to the error plz  this is my code can u modify it plz and give me the result of it when u check it on eclipse or jcreator plz and i will be more thankfull if u do that :) , oh yeh one thing can you draw a flag
Advertisements
can u plz try this program - Java Beginners
can u plz try this program  Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List Records. Each Record contains: Name(max 100 char), Age, Notes(No Maximum Limit
plz help me any one as fast as u can
plz help me any one as fast as u can  A thief Muthhooswamy planned... is the number of metres he can jump (1<=climbUp<=10^10) climbDown... Sample Input 1: 10:1:1:{10} Here Muthooswamy can jump 10 metres height
how the answer is 13 can anyone explain plz
how the answer is 13 can anyone explain plz  public class that { public static void main(String arr[]) { int i=3; int j=1; while(i<4) { //j=i; i=i+j/2; } System.out.println(i
can u plz help out how to attach file directly & send to a particular mail id
can u plz help out how to attach file directly & send to a particular mail id  i am building a project online LEAVE MANAGEMENT SYSTEM to our coll mini project so if a faculty write all details abt leave & shd send to HOD
JMeter HTTP request example
JMeter HTTP request example  Concerning: http://www.roseindia.net/jmeter/using-jmeter.shtml how do I set path? also what do i need to do to get the helloworld servlet work? Thanks in advance
How to send HTTP request in java?
How to send HTTP request in java?  How to send HTTP request in java
JavaScript XML Http Request
JavaScript XML Http Request  ...;, url, true) to make a GET request for the given url 'data.xml'. It provides...; Here is the code: <html> <h2>XML HTTP Request<
Retrieve HTTP Request Headers using JSP
Retrieve HTTP Request Headers using JSP   ... the request headers. When a HTTP client sends a request, it is required to supply GET...-Alive value or gets a  request line indicating HTTP 1.1, it may
plz explain me the output of program - Java Beginners
plz explain me the output of program  Hi friends, can u please explain me the output of below program with proper explanation of each and every line... Three integer variables(a,b,c) and three methods have been defined
how can u reduce the size of textfield?
how can u reduce the size of textfield?  how can u reduce the size of textfield? thanks in advance   import javax.swing.*; public class ReduceTextField extends JFrame { public static void main(String
How to fireup HTTP request from JavaFX Client
How to fireup HTTP request from JavaFX Client  Please tel me how do I can fire HTTP post request from an JavaFX client. Sceneario: I've an JavaFX... i've working version of JSP Code to handle HTTP post request tested by posting
Java Servlet : Http Request Headers
Java Servlet : Http Request Headers In this tutorial, you will learn how to Http Request Headers works in java servlet. Http Request Headers : HTTP Request Header is a request line text that a HTTP client(eg. web browser)sends
can any one explain this
can any one explain this  class Clidder { private final void flipper() { System.out.println("Clidder"); } } public class Ex3 extends Clidder { public final void flipper() { System.out.println
can you explain ?
can you explain ?  my dear can you teel me the explaintion for this code i need it GregorianCalendar cal = new GregorianCalendar(y, m, 0...(); } } iam explain whole code exept this part can you help
How to get country locale from a http request
How to get country locale from a http request  Hi, I Have a requirement like , i need to get the country locale(from whcih country he is logged... to implement business logic. Can anyone help me out to get this done. any help
can u help me to get a calendar with color codes on days ???
can u help me to get a calendar with color codes on days ???  hi roseindia, Can you help me to get the code, I need a calendar with color codes.i,e....... NOTE:Its a calendar not a date-picker PLZ can you help me, its very urgent
CAN U HELP ME TO CODE IN JSP FOR ONLINE VOTING SYSTEM
CAN U HELP ME TO CODE IN JSP FOR ONLINE VOTING SYSTEM  can u help me to code in jsp for online voting system
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
Specific Request Headers in JSP
Specific Request Headers in JSP          Whenever an http client sends a request, it can also sends the headers with it. All the headers are optional except
HTTP Status 405 - Request method 'GET' not supported. Its urgent
HTTP Status 405 - Request method 'GET' not supported. Its urgent  ...') in onclick method, following error is displaying in new window. "HTTP Status 405 - Request method 'GET' not supported." Anybody reply ASAP, its urgent
plz anyone can solve my
plz anyone can solve my  creat an applet prog which accepts the details of 10 customers like name , address , city , ect. and display it   import java.awt.*; import javax.swing.*; import java.awt.event.*; import
methods can be invoked by the container on a stateless session bean
methods can be invoked by the container on a stateless session bean  Which of the following methods can be invoked by the container on a stateless session bean
Explain Transparent Persistence - Hibernate
Explain Transparent Persistence   Hi Friends, Can u plz explain Transparent Persistence briefly  Hi Follow this link to find solution of your problem... http://www.roseindia.net/jdotutorials/jdo
this code gives addition of 2 numbers in j2me..but the code is not executing ..can u pls find out the error...??
this code gives addition of 2 numbers in j2me..but the code is not executing ..can u pls find out the error...??  import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class add1 extends MIDlet implements
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me
displaying List of records from database in a jsp using ajax, onclick it should display the results ?? its urgent can u help me   displaying List... ?? its urgent can u help me
Can a abstract class be defined without any abstract methods?
Can a abstract class be defined without any abstract methods?   hi, Can a abstract class be defined without any abstract methods? thanks
Can we replace main() with static block or with other static methods?
Can we replace main() with static block or with other static methods?  what is the use of public static void main()?can't we achieve the same thing through static block or through other static methods
How Can I get ArrayList of Data from jsp with ajax request
How Can I get ArrayList of Data from jsp with ajax request  Hi, I retereved 5 Employee Record of Data from Struts Action class to jsp with ajax response. But I don't how how can reterve this dynamic 5 employee records
Request Headers In EL
Request Headers In EL          Whenever an http client sends a request...; <h1>By using the EL we can retrieve the request headers</h1> <
Advertisements
 

 

 

DMCA.com