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
  msf desalination matlab code Guest 0 0 08-10-2018 05:01 PM
Last Post: Guest
  verilog code to implement nikhilam sutra Guest 2 0 25-09-2018 08:00 PM
Last Post: Guest
  automatic timetable generator for collage source code in php Guest 0 0 10-09-2018 09:57 AM
Last Post: Guest
  matlab code for iris recognition using wavelets Guest 0 0 11-05-2018 07:49 AM
Last Post: Guest
  leaky bucket source code in opengl Guest 0 0 02-05-2018 05:58 PM
Last Post: Guest
  opengl code for leaky bucket Guest 0 0 02-05-2018 06:43 AM
Last Post: Guest
  leaky bucket source code in opengl Guest 0 0 24-04-2018 08:13 PM
Last Post: Guest
Information java source code for video steganography tina28 4 6,320 20-04-2018 07:29 PM
Last Post: Guest
  opengl code for leaky bucket Guest 0 0 19-02-2018 05:23 PM
Last Post: Guest
  column bypassing multiplier code verilog Guest 1 0 01-02-2018 10:52 AM
Last Post: dhanabhagya
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: