JSP code for online hotel management system for connecting it with mysql database

I need JSP code for online hotel management system for connecting it with mysql database urgently...
can somebody provide that??

😔😕😕😕

Replies

  • ecneha
    ecneha
    I was in lil bit hurry...so I created a new thread....
    sorry for that..
  • sookie
    sookie
    Hi ecneha,

    Just check this out if can solve your problem - Connecting to MySQL database and retrieving and displaying data in JSPpage. This will provide you how to make connection to your database but it can't help you in rest of the hotel management code 😀
  • Vijay Khatri
    Vijay Khatri

    Hi,

    Here I am listing a few code but You can get the complete code from Learn SQL - [2023] Best SQL Tutorials | Hackr.io

    <%@ page import ="java.sql.*" %>
     <%@ page import ="javax.sql.*" %>
     <%
     String userid=request.getParameter("user");
     session.putValue("userid",userid);
     String pwd=request.getParameter("pwd");
     Class.forName("com.mysql.jdbc.Driver");
     java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/
     test","root","root");
     Statement st= con.createStatement();
     ResultSet rs=st.executeQuery("select * from users where user_id='"+userid+"'");
     if(rs.next())
     {
     if(rs.getString(2).equals(pwd))
     {
     out.println("welcome"+userid);

     }
     else
     {
     out.println("Invalid password try again");
     }
     }
     else
     %>

You are reading an archived discussion.

Related Posts

Dear frends, Hi this is arun doing my 2 nd year mechanical engineering . in my college we are doing a exhibition , i am so eager to place my...
Salam, I am a student of 5th semester , electronics engg. and i am given a project of making any program using general functions of matlab, dear seniors and juniors......
Can anybdy tell abt fuzzy logic
What is the Exact procedure to reset a out of order Transformer?? What are the basic steps to ensure the safety??
Here's a question for all the entrepreneurs/wannabe entrepreneurs: Who's your entrepreneur idol, why?