Servlet Code to Update records in SQL database using Tomcat server

In this post we will illustrate how to Search and display information from database. This post is continued from previous post have a look on how to do: 1. Database settings and Insetion of data into SQL database. 2. Searching information from Database 3. Deleting informstion from database Create a html form upinfo.html <html> <head> <h1><u>student form</u></h1> </head> <body bgcolor="DarkSalmon"> <form name=Student method=POST action=http://localhost:8080/examples/servlet/upinfo> <font face="Copperplate Gothic Bold">STUDENT NAME</font face>:<input type="text" name="t1"...
Read more »

Servlet Code to Delete information from SQL database Tomcat server

In this post we will illustrate how to delete information from database. This post is continued from previous post have a look on how to do: 1. Database settings and insetion of data into SQL database. 2. Searching information from database. Create a html form delinfo.html <html> <head> <h1><u>student form</u></h1> </head> <body bgcolor="DarkSalmon"> <form name=Student method=POST action=http://localhost:8080/examples/servlet/delinfo> <font face="Copperplate Gothic Bold">ID</font face>:<input type="text" name="t2" size="30"><p><br> <br> <input type="submit"...
Read more »

Servlet Code for Searching information from SQL database Tomcat Server

In this post we will illustrate how to Search and display information from database.This post is continued from previous post have a look on how to do: 1. Database settings & Insetion of data into SQL database. Create a HTML page named searchinfo.html <html> <head> <h1><u>student form</u></h1> </head> <body bgcolor="DarkSalmon"> <form name=Student method=POST action=http://localhost:8080/examples/servlet/searchinfo> <font face="Copperplate Gothic Bold">ID</font face>:<input type="text" name="t2" size="30"><p><br> <br> <input type="submit" value="submit"> </form> </body> </html> Now...
Read more »

Servlet code to insert data into MS SQL database using Tomcat Server

Unlike JSP and PHP Servlet is also server side scripting language. Servlet is Java based, Here this post we are going to illustrate how to add, delete , update and Search data from a form interacting with SQL database. For consideration we will need tomcat server installed running on the system by default at port 8080 and sql database running on the system. STEP 1: Create database in Microsoft sql Query analyser . Create table with 4 fields viz StudentName , ID , Age and Branch. ->Keep ID as  INT and set it as primary key ->keep StudentName as VARCHAR(100) ->keep age as INTEGER ->Keep Branch as VARCHAR(100) STEP 2 : This...
Read more »