5/17 - Hotel Management System | Java Project | Creating Connection with the database

Sdílet
Vložit
  • čas přidán 5. 04. 2022
  • In this video we will create our connection with the MySQL Database using a concept called JDBC. VERY IMPORTANT FOR INTERVIEW
    Please find the playlist of Complete Hotel Management System Java Project
    • 1/17 - Hotel Managemen...
    Technologies Used: Core Java (Swing & AWT)
    Database Used: MySQL
    IDE used: Netbeans
    ---------------------------------------------------------------------------------------------
    Please find the source code of the Project
    github.com/kunaltyagi9/Hotel-...
    Please find the Google Drive link for icons and database file
    drive.google.com/drive/folder...
    Please find Google Drive link for Project File
    drive.google.com/drive/folder...
    ---------------------------------------------------------------------------------------------
    Please contribute the documentation of this Project to help others
    How to Download Java, watch this video
    • Install Java JDK 17 on...
    How to Download Netbeans, watch this video
    • How to Download and In...
    How to Download MySQL, do watch this video
    • How to Install MySQL o...
    Java Projects Playlist: • 1/12 - Bank Management...
    JavaScript Projects Playlist: • JavaScript Projects
    React Projects Playlist: • React Projects
    MERN Stack Projects Playlist: • MERN Stack Projects
    Follow Us
    Instagram: codeforinterview ( / codeforinterview )
    Telegram: codeforinterview (t.me/codeforinterview)

Komentáře • 186

  • @codeforinterview
    @codeforinterview  Před 2 lety

    Please find below the playlist of Hotel Management System
    czcams.com/video/E7m5ci3dsKo/video.html
    Watch the next video to create the AddEmployee class
    czcams.com/video/zpilHuidl3k/video.html

  • @amarnatha1614
    @amarnatha1614 Před 6 měsíci

    Very detailed explanation thank you so much

  • @pravingouda568
    @pravingouda568 Před rokem +3

    7:18 i have never used sql workbench how did you open the file tab where you wrote create data base please help

    • @codeforinterview
      @codeforinterview  Před rokem

      press ctrl + n
      or check the header tab options for the new file

  • @samarkhan4100
    @samarkhan4100 Před rokem

    Hello its giving me and error on unknown column 'password' in where clause
    i have checked every line of code still couldn't able to fix it

  • @m.ahmedraza2803
    @m.ahmedraza2803 Před rokem

    I am waiting for you sir😊

  • @pritigaidhane6298
    @pritigaidhane6298 Před rokem

    I have already added jar file still error during login again and again plz sir help i have to submit this project for my final year

  • @vobensingh8404
    @vobensingh8404 Před 6 měsíci

    7:36 can't create databse hotelmanagementsystem , error shown. How do i handle??

  • @wittypunk
    @wittypunk Před rokem

    What is the meaning of( this ) in action listener...what if the interviewer asks me what should I say

  • @vivekgopari9848
    @vivekgopari9848 Před 11 měsíci

    the code you are writing in the video, and the code in github which u provided is different

  • @rakshasharma8191
    @rakshasharma8191 Před 7 měsíci

    It's showing the same error after logging... invalid userid and password.. How to solve this issue

  • @netakalif101
    @netakalif101 Před rokem

    that was super helpful! do you by any chanse have english translate? or videos in english?

  • @srishti.this.side.
    @srishti.this.side. Před 9 měsíci

    💥💥💥💥💥

  • @ShivamSrivastava223
    @ShivamSrivastava223 Před rokem +1

    i am facing this error: Cannot invoke "javax.swing.JTextField.getText()" because "this.password" is null
    what should i do ?

    • @ShivamSrivastava223
      @ShivamSrivastava223 Před rokem

      this error is in my password

    • @codeforinterview
      @codeforinterview  Před rokem

      make sure you have removed the local declaration of JTextField after declaring it as global variable

  • @pudisruthi673
    @pudisruthi673 Před 10 měsíci +2

    Bro while after login it’s not opening dashboard it’s showing error cannaot invoke sql.statement.execute query of string because c.s is null

    • @codeforinterview
      @codeforinterview  Před 10 měsíci

      Go to conn class, in the catch section, write this
      e.printStackTrace();
      run the application again and this time another expection will print on console
      reply with that exception

    • @diptipundir3728
      @diptipundir3728 Před 6 měsíci

      ​@@codeforinterviewc.s is null same yhi error dera tb bhi

    • @malavshah6244
      @malavshah6244 Před 6 měsíci +1

      ​@@diptipundir3728 i think you have declared it 2 times (JTextField and JButton) remove it from username and in the code.

    • @diptipundir3728
      @diptipundir3728 Před 6 měsíci

      @@malavshah6244 thanku abhi chlgya sb shi se or humara project complete bhi hogya 😊

  • @pritiguria7717
    @pritiguria7717 Před 4 měsíci

    What is the type of architecture in this?

  • @rrbaleri
    @rrbaleri Před měsícem

    Sir I'm using vs code for this project I can't understand why there is some glitch when the code runs like menu and menu item takes some time to get visible

  • @ankitray4873
    @ankitray4873 Před rokem +1

    Sir login button not working properly
    When I click login button i proper fill username and password then says invalid username and password why? But cancel button work properly

    • @ankitray4873
      @ankitray4873 Před rokem

      Sir no any solution sir

    • @SUB-np7uk
      @SUB-np7uk Před rokem

      @@ankitray4873
      check for currently using database
      check for field names in database also check field names in project,
      JTextField userName;
      JPasswordField password;
      userName = new JTextField();
      password = new JPasswordField()
      String user = userName.getText();
      String pass = password.getText();
      String query = "SELECT * FROM login WHERE username = '" + user + "' AND password = '" + pass + "'";
      where my table is
      create table login(username varchar(25), password varchar(25));

  • @bipashasemwal3988
    @bipashasemwal3988 Před 10 měsíci

    I'm unable to add jar files. Does anyone know?

  • @arpitchauhan5212
    @arpitchauhan5212 Před 2 lety

    I'm using VS Code IDE and facing some problem during connecting with the database Jar file isn't opening in my PC tell me where I should locate my Jar file.. I created a folder called Libraies and pasted the jar file in that browser..

    • @codeforinterview
      @codeforinterview  Před 2 lety +1

      I am sorry, I never ran java in vs code. So, I have no clue

    • @SUB-np7uk
      @SUB-np7uk Před rokem

      ik its late but for newcommers
      on the left of the VS code IDE in u have EXPLORER section im not that fammiliar with terminology so ill explain it as simple as i can
      so on the top u have "basic folder structure for a project" ex "hotelmanagementsystem" and folders inside (i think IDE sees it as just folder structure not a project structure)
      and thers also
      OUTLINE
      TIMELINE
      AND THERE SHOULD BE "JAVA PROJECTS" (thats probaly what IDE sees as a java project)
      there should be something called "Refferenced Libraries" u just simply click + button and looking for a file in a windows file explorer

    • @creativeidea6518
      @creativeidea6518 Před 6 měsíci

      same problem in vs code please tell me about this problem...@@SUB-np7uk

  • @khatol5825
    @khatol5825 Před rokem +2

    Hello sir
    Having this problem.. kindly help to resolve. The login button gives this error
    java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'admin' and password = '12345'' at line 1

    • @hafsa8789
      @hafsa8789 Před rokem

      Same error
      Have your error resolved and how?

  • @amit4310
    @amit4310 Před rokem

    Not action is performed when clicking cancel so what can i do plss reply sir

  • @varshashrestha84
    @varshashrestha84 Před rokem

    Sir can you pls tell me how can I connect xampp database in this java project bcz my MySQL is not working

  • @m.ahmedraza2803
    @m.ahmedraza2803 Před rokem

    Hey sir Agr hm hotel management system main jar file lagatay hein phir project bilkul mast chalta ha or zip file main kar ky kisi dusray laptop main run krain gay tw kia wo jo jar file dubara lagani hogi yah khud wo lagi hogi phelay sae ?

  • @manishabhardwaj1416
    @manishabhardwaj1416 Před rokem

    I want to blinking text (The tan group welcomes you)in dashboard class but if I login using login class then It shows blank frame in dashboard class no image no text please help me to adjust this

    • @codeforinterview
      @codeforinterview  Před rokem

      You can move ahead without this, because you will not come back to the Splash screen after the Login screen

    • @manishabhardwaj1416
      @manishabhardwaj1416 Před rokem

      @@codeforinterview why what's the reason???

    • @manishabhardwaj1416
      @manishabhardwaj1416 Před rokem

      And if I apply image slides on dashboard if I login using login class then also so blank on the dashboard class frame

    • @manishabhardwaj1416
      @manishabhardwaj1416 Před rokem

      Sir reply please

  • @rushikeshmane7577
    @rushikeshmane7577 Před 3 měsíci

    Sir i am getting error in login class when i extends Jframe amd implement action listener
    Error showing on screen is- login is not abstract and does not override abstract method actionperformed
    Please help

    • @codeforinterview
      @codeforinterview  Před 3 měsíci

      make sure you have the below method in the class with the exact syntax and case.
      public void actionPerformed(ActionEvent ae){}

    • @codeforinterview
      @codeforinterview  Před 3 měsíci +1

      The spelling with correct casing is actionPerformed, make sure you are writing the same
      public void actionPerformed(ActionEvent ae){}

    • @rushikeshmane7577
      @rushikeshmane7577 Před 3 měsíci

      Sir i am putting right username and password then also it is showing invalid

  • @CreativeLife852
    @CreativeLife852 Před 11 měsíci

    Sir data base can't create in MySQL what we do

  • @AnkitKumar-xj5jz
    @AnkitKumar-xj5jz Před rokem

    Sir , when I click login button then it show invalid username and password while I proper fill username and password then it says invalid username and password why? While cancel button works properly sir tell me immediatry sir i am waiting to your response sir

    • @codeforinterview
      @codeforinterview  Před rokem

      Do you have any space in the mysql table after username and password?

    • @AnkitKumar-xj5jz
      @AnkitKumar-xj5jz Před rokem

      @@codeforinterview yes sir

    • @SUB-np7uk
      @SUB-np7uk Před rokem

      ​@@AnkitKumar-xj5jz
      check for currently using database
      check for field names in database also check field names in project,
      JTextField userName;
      JPasswordField password;
      userName = new JTextField();
      password = new JPasswordField();
      String user = userName.getText();
      String pass = password.getText();
      String query = "SELECT * FROM login WHERE username = '" + user + "' AND password = '" + pass + "'";
      where my table is
      create table login(username varchar(25), password varchar(25));

  • @averagefan2397
    @averagefan2397 Před rokem

    I'm getting this error Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
    java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)

    • @SUB-np7uk
      @SUB-np7uk Před rokem

      looks like ur not passing password as an argument for connecting to db but im not sure

  • @ankitray4873
    @ankitray4873 Před rokem

    Sir in class actionperformed class
    In string pass = password. getText (in getText strikethrough symbool ) is found why?

    • @codeforinterview
      @codeforinterview  Před rokem

      It is just a deprecation warning, ignore that
      or you can change this function to getPassword

    • @ankitray4873
      @ankitray4873 Před rokem

      @@codeforinterview sir if I changed
      String pass = password. getpassword() then getpassword get error why?

    • @codeforinterview
      @codeforinterview  Před rokem

      @@ankitray4873 getPassword(), with P uppercase

    • @ankitray4873
      @ankitray4873 Před rokem

      @@codeforinterview sir whole line get error

    • @codeforinterview
      @codeforinterview  Před rokem

      @@ankitray4873 you must have got the typecast error, typecast it in a string. It will work
      new String(passsword.getPassword());

  • @mukeshruwali2445
    @mukeshruwali2445 Před 7 měsíci

    hello sir my login code is not working and i am not able to get the ans could you please help me.

  • @AbdulRehman-er2lw
    @AbdulRehman-er2lw Před 2 lety

    did you changed the code which u have uploaded on github??
    i have connected the database but the problem i am facing is that it is unable to check the username and pass from the mysql, despite of entering right username and password , it is showing me invalid password and username

    • @codeforinterview
      @codeforinterview  Před 2 lety

      please check the mysql query you are executing

    • @AbdulRehman-er2lw
      @AbdulRehman-er2lw Před 2 lety

      @@codeforinterview thanks for replying,
      i dropped the database and made a new one , now its working fine ..( I don't know how it worked 😂)

    • @codeforinterview
      @codeforinterview  Před 2 lety

      @@AbdulRehman-er2lw 😂😂

    • @poojitashripathi3146
      @poojitashripathi3146 Před rokem

      I am getting the same error even after entering correct username and password

    • @poojitashripathi3146
      @poojitashripathi3146 Před rokem

      package hotel.management.system;
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;
      import java.sql.*;
      public class Login extends JFrame implements ActionListener {
      JTextField username,password;
      JButton login,cancel;
      Login(){
      getContentPane().setBackground(Color.LIGHT_GRAY);
      setLayout(null);
      JLabel user= new JLabel("Username");
      user.setFont(new Font("self",Font.PLAIN,16));
      user.setBounds(40,20,100,30);
      add(user);
      username=new JTextField();
      username.setBounds(150,20,200,30);
      add(username);
      JLabel pass=new JLabel("Password");
      pass.setFont(new Font("self",Font.PLAIN,16));
      pass.setBounds(40,70,100,30);
      add(pass);
      password=new JTextField();
      password.setBounds(150,70,200,30);
      add(password);
      login=new JButton("Login");
      login.setFont(new Font("self",Font.PLAIN,16));
      login.setBackground(Color.WHITE);
      login.setForeground(Color.BLACK);
      login.setBounds(40,150,100,30);
      login.addActionListener(this);
      add(login);
      cancel=new JButton("Cancel");
      cancel.setFont(new Font("self",Font.PLAIN,16));
      cancel.setBackground(Color.WHITE);
      cancel.setForeground(Color.BLACK);
      cancel.setBounds(200,150,100,30);
      cancel.addActionListener(this);
      add(cancel);
      //ImageIcon i1=new ImageIcon(ClassLoader.getSystemResource("/icons/second.jpg"));
      // JLabel image=new JLabel(i1);
      java.net.URL i1=getClass().getResource("/icons/second.jpg");
      Icon see=new ImageIcon(i1);
      //Image i2= i1.getImage().getScaledInstance(200,200,Image.SCALE_DEFAULT);
      // ImageIcon i3=new ImageIcon(i2);
      JLabel image=new JLabel(see);
      image.setBounds(400,40,160,160);
      add(image);

      setBounds(500,200,600,300);
      setVisible(true);
      }
      public void actionPerformed(ActionEvent ae){
      if(ae.getSource()==login){
      String user=username.getText();
      String pass=password.getText();
      try{
      conn c =new conn();
      String query="select * from login where username - '" + user + "' and password - '" + pass + "'";
      ResultSet rs= c.s.executeQuery(query);
      if(rs.next()){
      setVisible(false);
      new Dashboard();
      }
      else{
      JOptionPane.showMessageDialog(null,"Invalid username or password");
      setVisible(false);
      }
      }catch(Exception e){
      e.getStackTrace();
      }
      }
      else if(ae.getSource()==cancel){
      setVisible(false);
      }
      }
      public static void main(String[] args){
      new Login();
      }

      }
      Above one is the code for login page

  • @simeechaudhary3135
    @simeechaudhary3135 Před 2 lety

    Sir mera database ki table tho bnri h Lakin create database hotelmanagementsystem m error ara h
    Error code: 1007 can't create database "hotelmanagementsystem" database exits

    • @codeforinterview
      @codeforinterview  Před 2 lety

      you already have a database with this name in your mysql

    • @pritigaidhane6298
      @pritigaidhane6298 Před rokem

      I also have same problem bt mera koi database create hua hi NH he isse phle

  • @munishgupta8186
    @munishgupta8186 Před 2 lety

    Sir me jab database create kiya to select * from login wali command run kari to workbench par bass username and password ki table bani ari hai lekin unki details ko ki admin aur 12345 thi vo show nhi hori

    • @codeforinterview
      @codeforinterview  Před 2 lety

      - using this command select * from login -> you can view the content of the table
      - to create the table we use this command (create table tablename(columnname datatype);)
      - Did you use insert command to insert values in the table?

    • @munishgupta8186
      @munishgupta8186 Před 2 lety

      @@codeforinterview sir jab insert into login values karke value insert kar rha hu to error dera hai no database selected , select the default DB to be used

    • @codeforinterview
      @codeforinterview  Před 2 lety

      @@munishgupta8186 use databasename;
      run this command first
      replace databasename with your actual database name before running this command
      after that run your insert table command

  • @m.ahmedraza2803
    @m.ahmedraza2803 Před 2 lety

    Sir ma database ka table banata hu likn error aarah ha
    Error: can’t create database hotelmanagementsystem; database exists what is this bro help me ????

    • @codeforinterview
      @codeforinterview  Před 2 lety +1

      your database with this name is already exist in the database
      show databases;
      you can use this command to check the existing databases in mysql

    • @m.ahmedraza2803
      @m.ahmedraza2803 Před 2 lety

      @@codeforinterview sir jab ma project run krta hon tou Added ni horahe database mein. Matlab Add Drivers wali class mein mne add kia likn pechay database mein add ni horhi sir plz help me.??

  • @Yashniboriya7
    @Yashniboriya7 Před rokem

    sir login or cancel button pr click krne pr kuch bhi actuon perform nhi ho rha ,click krne pr bhut sare exceptions aa rhe hai.Please help

    • @codeforinterview
      @codeforinterview  Před rokem

      please reply with the errors you are getting

    • @anishabagal3805
      @anishabagal3805 Před 10 měsíci

      Sir login button par click karne ke. Bad wo invisible ho Raha hai lekin aage ka page nahi dikha raha

  • @asavaripatil
    @asavaripatil Před 10 měsíci

    Sir after doing this my cancel button is working properly but login button is not working what can i do sir

    • @tejasmaloor2507
      @tejasmaloor2507 Před 10 měsíci

      At 15:55 while adding the action listener to the cancel button he made a mistake change it to "cancel.addActionListener(this);" instead of "login.addActionListener(this);"

    • @asavaripatil
      @asavaripatil Před 10 měsíci

      Thanks❤

    • @asavaripatil
      @asavaripatil Před 10 měsíci

      But error is same

  • @rutujathakur3219
    @rutujathakur3219 Před 2 lety

    Sir my page is not opening after I login the dashboard page not opening...if I go to dashboard file from then I run it is opening..But when I click to login it's not...help me

    • @codeforinterview
      @codeforinterview  Před 2 lety

      what is the error you are getting on console?

    • @rutujathakur3219
      @rutujathakur3219 Před 2 lety

      @@codeforinterview there is no error but after clicking the login button the dashboard is opening but it's not showing anything...But when I separately open dashboard it's showing clearly...help me

    • @rutujathakur3219
      @rutujathakur3219 Před 2 lety

      @@codeforinterview help me sir...I want to submit that project

    • @codeforinterview
      @codeforinterview  Před 2 lety

      @@rutujathakur3219 please comment down below the code you have written inside dashboard class

    • @rutujathakur3219
      @rutujathakur3219 Před 2 lety

      @@codeforinterview
      /*
      * To change this license header, choose License Headers in Project Properties.
      * To change this template file, choose Tools | Templates
      * and open the template in the editor.
      */
      package hotel.management.system;
      import javax.swing.*;
      import java.awt.*;
      import java.sql.*;
      /**
      *
      * @author Acer
      */
      public class DashBoard extends JFrame {

      DashBoard() {
      setBounds(0, 0, 1550, 1000);

      setLayout(null);

      ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/third.jpg"));
      Image i2 = i1.getImage().getScaledInstance(1550, 1000, Image.SCALE_DEFAULT);
      ImageIcon i3 = new ImageIcon(i2);
      JLabel image = new JLabel(i3);
      image.setBounds(0, 0, 1550, 1000);
      add(image);

      JLabel text = new JLabel("THE THAKUR HOTEL WELCOMES YOU!!!");
      text.setBounds(300, 80, 1000, 50);
      text.setFont(new Font("Tahoma", Font.BOLD, 40));
      text.setForeground(Color.black);
      image.add(text);

      JMenuBar mb = new JMenuBar();
      mb.setBounds(0, 0, 1550, 30);
      image.add(mb);

      JMenu hotel = new JMenu("HOTEL MANAGEMENT");
      hotel.setForeground(Color.BLUE);
      hotel.setFont(new Font("Tahoma", Font.BOLD, 15));
      mb.add(hotel);

      JMenuItem reception = new JMenuItem("RECEPTION");
      reception.setForeground(Color.RED);
      reception.setFont(new Font("Tahoma", Font.BOLD, 15));
      hotel.add(reception);

      JMenu admin = new JMenu("ADMIN");
      admin.setForeground(Color.BLUE);
      admin.setFont(new Font("Tahoma", Font.BOLD, 15));
      mb.add(admin);

      JMenuItem addempolyee = new JMenuItem("ADD EMPOLYEE");
      addempolyee.setForeground(Color.RED);
      addempolyee.setFont(new Font("Tahoma", Font.BOLD, 15));
      admin.add(addempolyee);

      JMenuItem addrooms = new JMenuItem("ADD ROOMS");
      addrooms.setForeground(Color.RED);
      addrooms.setFont(new Font("Tahoma", Font.BOLD, 15));
      admin.add(addrooms);

      JMenuItem adddrivers = new JMenuItem("ADD DRIVERS");
      adddrivers.setForeground(Color.RED);
      adddrivers.setFont(new Font("Tahoma", Font.BOLD, 15));
      admin.add(adddrivers);

      setVisible(true);

      while(true){
      text.setVisible(false);
      try{
      Thread.sleep(500);
      }catch (Exception e) {
      e.printStackTrace();
      }
      text.setVisible(true);
      try{
      Thread.sleep(500);
      }catch (Exception e) {
      e.printStackTrace();
      }
      }
      }

      public static void main(String[] args){
      new DashBoard();
      }
      }

  • @creativeidea6518
    @creativeidea6518 Před 6 měsíci

    sir aapne jaar file kaha per di hai....

  • @ankitray4873
    @ankitray4873 Před rokem

    Sir, when I implements ActionListener then login class gets error why?

    • @codeforinterview
      @codeforinterview  Před rokem

      What is the error?

    • @ankitray4873
      @ankitray4873 Před rokem

      @@codeforinterview sir i try more then two three times allready error is gone but in lecture 5 I set jar file but didn't work it I complete lecture 5 at last give me error all class are working good but conn class didn't work?

    • @codeforinterview
      @codeforinterview  Před rokem

      @@ankitray4873 What is the error?

    • @ankitray4873
      @ankitray4873 Před rokem

      @@codeforinterview java. Lang. Classnotfoundexception : com. Mysql. Cj. Jdbc. Driver

    • @ankitray4873
      @ankitray4873 Před rokem

      @@codeforinterview sir cancel button is working bot login button is not working it give an error

  • @pritigaidhane6298
    @pritigaidhane6298 Před rokem

    Unable to add jar file what to do ?

  • @shashwat4299
    @shashwat4299 Před 2 lety

    Bhai yaar communication linking failure between database and the project in intellijay kahi koi solution nahi mil raha ab yeah mat kahiya i have not used intellij idea for java javal. Sql. Communication failure unknown database and cannot connect in intellijay 20 tarik se pehle solve kar saktey ho toh help kardo because myndeadline is on 20 may

    • @codeforinterview
      @codeforinterview  Před 2 lety

      are you using wampserver/xammpserver?

    • @shashwat4299
      @shashwat4299 Před 2 lety

      @@codeforinterview no but yes I have installed it on my pc

    • @codeforinterview
      @codeforinterview  Před 2 lety

      @@shashwat4299 uninstall it and it will resolve your issue

    • @shashwat4299
      @shashwat4299 Před 2 lety

      @@codeforinterview i have done this now but still the problem exist what should I do now i am literallly feeling helpless as there is no one to guide but thanks for the reply keep making good videos

    • @codeforinterview
      @codeforinterview  Před 2 lety

      @@shashwat4299 make sure your mysql is up and running
      press window + r
      type services.msc
      search for mysql
      and make sure it is up and running

  • @samheetagourammolla6111

    Sir getting error as Null Pointer Exception

    • @codeforinterview
      @codeforinterview  Před 2 lety

      please comment down below the full exception you are getting

  • @suman_mouriya
    @suman_mouriya Před 4 měsíci

    sir my sql connect krne me problem aa rhi hai.

  • @riturajsingh8415
    @riturajsingh8415 Před rokem

    "c1.s" is null this error is comming in login file

    • @codeforinterview
      @codeforinterview  Před rokem

      you have an error in the conn class, do you have any other error on console?

    • @SUB-np7uk
      @SUB-np7uk Před rokem

      maybe mysql connector isnt added to classpath

  • @arpitsharma2920
    @arpitsharma2920 Před rokem

    Ye zip file laptop ma download ni hori

  • @prachishetty3763
    @prachishetty3763 Před 8 měsíci

    Are bro source code different hai jo aapne description mai upload kiya hai🙂😭

  • @pravingouda568
    @pravingouda568 Před rokem

    17:18 now im getting the same error class does not have a main method , before this video in part 4 every thing was running smooth but now it isnt (is there any way can i contact you? whatsapp discord,etc?)

    • @codeforinterview
      @codeforinterview  Před rokem

      don't run conn class, it does not have the main method.

    • @pravingouda568
      @pravingouda568 Před rokem

      @@codeforinterview i can not run login dashboard too they all show the same error

    • @codeforinterview
      @codeforinterview  Před rokem

      @@pravingouda568 go inside the login class, right click on the code and click on run application

    • @pravingouda568
      @pravingouda568 Před rokem

      @@codeforinterview so it's isn't my file issue right?? Some of my friends are saying that I miss placed my file somewhere

  • @MohitSingh-ki7mm
    @MohitSingh-ki7mm Před rokem

    password or username dalna k baad error ara h
    Java.lang.classnotfoundexception:conn.mysql.cj.jdbc.Driver
    or mene mysql-connector-java isko bhi library main paste kr diya fir bhi

    • @codeforinterview
      @codeforinterview  Před rokem +1

      your driver is wrong, com.mysql.cj.jdbc.Driver
      replace conn with com

    • @MohitSingh-ki7mm
      @MohitSingh-ki7mm Před rokem

      @@codeforinterview thanks vo problem to solve ho gayi but ab ek nayi problem aa rahi hain or vo yeh hain
      java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

    • @codeforinterview
      @codeforinterview  Před rokem

      @@MohitSingh-ki7mm you have to mention the same password in your conn class which you use to open mysql

    • @MohitSingh-ki7mm
      @MohitSingh-ki7mm Před rokem

      maine password bilkul same dal rakha hain bhai yrr fir bhi

  • @Karishmashaikh-bo6vl
    @Karishmashaikh-bo6vl Před 2 měsíci

    Sir login button pe click karne ke baad error aa raha hai

  • @rishab6968
    @rishab6968 Před 2 lety

    Your old account got deleted? :((

    • @swapnildubey7730
      @swapnildubey7730 Před 2 lety

      Yes bro
      Bhai ka channel suspend ho gaya tha kyuki unka system hack ho gaya tha to CZcams community guidelines ke against sb kr rhe thay jinhone bhi hack kiya tha.
      Or inn sb ke vjh se bhaiya ka channel delete ho gaya 😥😢

    • @codeforinterview
      @codeforinterview  Před 2 lety

      Hi Rishab, thanks for the concern. Yeah! old channel got deleted in an unfortunate incident.

  • @Richa12300
    @Richa12300 Před rokem

    Sir iska database kaise bnega

    • @codeforinterview
      @codeforinterview  Před rokem

      I have taught everything in the video, kindly watch the video

  • @m.ahmedraza2803
    @m.ahmedraza2803 Před rokem

    Sir plz reply krain apko dm text kia mne

  • @m.ahmedraza2803
    @m.ahmedraza2803 Před rokem

    Sir plz dm reply krain 🙏🏻

  • @m.ahmedraza2803
    @m.ahmedraza2803 Před rokem

    Sir dm msg kia reply plz 🥺

  • @HarendraRanjan
    @HarendraRanjan Před 11 měsíci

    main ye project es chainla se hi start kiya tha magar main ne esko chhod diya kyu ki mujhe sahi se dikh hi nahi raha tha or mere sab

  • @MohitSingh-ki7mm
    @MohitSingh-ki7mm Před rokem

    bhai tu apne comment bhi check kr liya kr

    • @codeforinterview
      @codeforinterview  Před rokem

      theek hai bhai 😂

    • @MohitSingh-ki7mm
      @MohitSingh-ki7mm Před rokem

      @@codeforinterview bhai comment dekh to leta yrr chal main dobara likh deta hun main yeh keh raha tha mera user id and password bilkul theek hain fir bhi vo same error throwen kr raha hain
      java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
      ab iska koi solution de de bhai maine insta pr bhi comment kiya

    • @codeforinterview
      @codeforinterview  Před rokem

      @@MohitSingh-ki7mm
      1) make sure you don't have multiple mysql installed in your system.
      2) You need to mention the same password which you use to login in mysql
      3) make sure your mysql is running on port 3306
      4) Run windows + r, type services.msc, click enter, search for mysql, make sure it is up and running

  • @smritiabha8034
    @smritiabha8034 Před rokem

    I need you help....

  • @abhinavsingh-us7fv
    @abhinavsingh-us7fv Před rokem

    sir I'm gettin error Classnot found Exception ,I'm adding jar file but they still
    java.lang.ClassNotFoundException: con.cj.mysql.jdbc.Driver
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:375)
    at hotel.management.system.Conn.(Conn.java:22)
    at hotel.management.system.Login.actionPerformed(Login.java:73)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    plz help me sir

    • @codeforinterview
      @codeforinterview  Před rokem

      you need to add a jar file in the project which is mysql-connector-java, add the same under the libraries section of the project

  • @simeechaudhary3135
    @simeechaudhary3135 Před 2 lety

    Sir login or password dalna k baad ab bhi error ara h
    Java.sql.sqlnontransientconnectionexpection:cannot load connection class because of underlying exception :com.mysql.cj.exceptions.wrongargunentexception:malformed database url, failed to parse tha main url section.

    • @codeforinterview
      @codeforinterview  Před 2 lety

      comment down below the code you have written inside conn class

    • @simeechaudhary3135
      @simeechaudhary3135 Před 2 lety

      @@codeforinterview package hotel.management.system;
      Import java.sql.*;
      Public class conn{
      Connection c;
      Statement s;
      Conn(){
      Try{
      Class.forName("com.mysql.cj.jbdc.Driver");
      C=Driver Manager.getConnection("jdbc:mysql://localhost:///hotelmanagementsystem",root","codeforinterview");
      S=c.creatstatement();
      }
      Catch (Exception e){
      e.printStackTrace();
      }
      }
      }

    • @codeforinterview
      @codeforinterview  Před 2 lety

      @@simeechaudhary3135 your driver name is wrong
      com.mysql.cj.jbdc.Driver
      com.mysql.cj.jdbc.Driver
      jdbc instead of jbdc

    • @simeechaudhary3135
      @simeechaudhary3135 Před 2 lety

      @@codeforinterview sir ab bhi ya hi error ara h

    • @codeforinterview
      @codeforinterview  Před 2 lety

      @@simeechaudhary3135 comment down below the error

  • @simeechaudhary3135
    @simeechaudhary3135 Před 2 lety

    Sir mera password or username dalna k baad error ara h
    Java.lang.classnotfoundexception:conn.mysql.cj.jdbc.Driver

    • @codeforinterview
      @codeforinterview  Před 2 lety

      you need to include the jar file in the project which is mysql-connector-java. Include it under the libraries section like I did in the video

  • @m.ahmedraza2803
    @m.ahmedraza2803 Před rokem

    Sir apko instagram pr message kia kindly check krain plz sir 🙏🏻

  • @lubnakhanam6181
    @lubnakhanam6181 Před rokem

    I have messaged you on instagram plz check

  • @AyushSharma-ng8oq
    @AyushSharma-ng8oq Před rokem

    sir i have messaged you on instagram please check