Important: Use custom search function to get better results from our thousands of pages

Use " " for compulsory search eg:"electronics seminar" , use -" " for filter something eg: "electronics seminar" -"/tag/" (used for exclude results from tag pages)


 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Servlet Database Java source code
Post: #1

Code:
import javax.servlet.*;
import java.sql.*;

public class ServletDatabase extends GenericServlet
{
    Connection con;
    PreparedStatement prst;
    ResultSer rs;
    public void init(ServletConfig sc)
    {
        try
        {
            Class.forName("jdbc.odbc.JdbcOdbcDriver");
            con = DriverManager.getConnection("Jdbc:Odbc:stud","eml","");
            super.init(sc);
        }
        catch(Exception e)
        {
            System.out.println(e.getString());
        }
    }
    
    public void service(SrevletRequest req,ServletResponse res)
    {
        try
        {
            res.setContextType("text/html");
            String s1 = req.getParameter("login");
            String s2 = req.getParameter("password");
            prst = con.PreparedStatement("Select eno,ename,desig,sal from emp where    
                            login=? password=?");
            ServletOutputStream sos = res.getOutputStream();
            rs = prst.executeQuery();
            if(rs.next())
            {
                int eno = rs.getInt(3);
                String name = rs.getString(4);
                String desig = rs.getString(5);
                float sal = rs.getFloat(6);
                sos.println("Employee No"+eno);
                sos.println("Employee Name"+name);
                sos.println("Designation"+desig);
                sos.println("Salary"+sal);    
            }
            else
            {
                sos.println("You are not a valid user, please try again");
            }
        }
        
            
    }
}
Post: #2
Hey I have a deal for you.
There are luxury towers in Bat Yam right on the sea and the price is going to rise a lot this year looking to make a very big profit or bring in customers and take a percentage.

You Interested in hearing details?
Post: #3

<html>
<body>
<form action="servlet/Register" method="post">

Name:<input type="text" name="userName"/><br/><br/>
Password:<input type="password" name="userPass"/><br/><br/>
Email Id:<input type="text" name="userEmail"/><br/><br/>
Country:
<select name="userCountry">
<option>India</option>
<option>Pakistan</option>
<option>other</option>
</select>

<br/><br/>
<input type="submit" value="register"/>

</form>
</body>
</html>
 

Marked Categories : java servlet, linkedin shareservlet, projects in servlet with source code, java servlets projects source code, servlet projects with source code database, login page with data base in java projects, project on java servlet source code download, source code of java projects in servlets, a technical seminar on java servelets, database java projects source code, java project source code using servlet, java servlet db, servlet database source code, source code for java servlet project, project source code for java servlet and topic, java servlet projects with source code, source code for login registration in java servlet, technical seminars on database,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Image Verification
(case insensitive)
Please enter the text within the image on the left in to the text box below. This process is used to prevent automated posts.

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  parachute code in opengl Guest 2 185 Yesterday 08:01 PM
Last Post: Guest
  projects in core java project topics 18 163,182 16-01-2018 07:39 AM
Last Post: Guest
  java applet project report helper 3 15,030,102 12-01-2018 10:44 AM
Last Post: dhanabhagya
  free download java free project in blossom bazaar Guest 1 0 08-01-2018 01:25 PM
Last Post: dhanabhagya
  detection of tumor in mri using vector quantization segmentation with matlab code Guest 1 243 08-01-2018 12:33 PM
Last Post: dhanabhagya
  ns2 code trust value calculation Guest 1 0 08-01-2018 12:17 PM
Last Post: dhanabhagya
  servlet jsp multiple choice questions and answers pdf Guest 2 2,866 08-01-2018 12:07 PM
Last Post: Guest
  online jewellery shop management software in asp net free download source code Guest 2 227 08-01-2018 01:09 AM
Last Post: Raymondnof
  madeenasuper net operator code Guest 1 246 06-01-2018 01:28 PM
Last Post: dhanabhagya
  distance relay matlabe code Guest 1 0 20-11-2017 12:24 PM
Last Post: jaseela123
This Page May Contain What is Servlet Database Java source code And Latest Information/News About Servlet Database Java source code,If Not ...Use Search to get more info about Servlet Database Java source code Or Ask Here

Options: