Java Eclipse GUI Tutorial 6 # Login Program for java with sqlite database PART- 2

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 65

  • @cacerra1234
    @cacerra1234 8 років тому

    First of all, this is just a wonderful set of videos, I thank you so much.... Next, I was having the same error as a few below, and that is: java.sql.SQLException:[SQLITE_ERROR]SQL error or missing database (no such such table : EmployeeInfo )...
    what it turned out to be for me was pathing issue for my DB..... my DB "EmployeeData.sqlite"... lives in DIR x, however in dir x there is another dir that sqlite created called "docs".... there is another EmployeeData.sqlite there. That is the one I had defined in my sqliteConnection class.... and that is exactly why... I kept getting the Connection Successful message, yet I really was not connecting to my actual DB. I changed the path and bingo.... success... Good luck all.

  • @wickedsnuk3812
    @wickedsnuk3812 5 місяців тому

    Hi man, thank you! you saved my life

  • @antonykhomeriki2680
    @antonykhomeriki2680 9 років тому

    Instead of using getText(), may be it is a bit useful to use String.valueOf( passwordField.getPassword())
    or String PasswordTyped = new String(passwordField.getPassword());
    Great tutorials, I really enjoy it...

  • @LeDatte
    @LeDatte 5 років тому

    you're the best, still helpful today.

  • @LeandroCabranes
    @LeandroCabranes 10 років тому

    Great tutorials, just try to explain some concepts that could be new for some people trying to learn WindowBuilder. Keep making videos :D

  • @emerlander
    @emerlander 7 років тому

    [Solved]
    Like the others here I had the same error. Here's the solution: Let's keep in mind two things here. First he creates a database. He names it 'EmployeeData'. He then creates a table within that database. He names it 'EmployeeInfo'. In tutorials #3 and #4 (Data Connection) he gives connection to the 'database'. Its name is 'EmployeeData'. In tutorials #5 and #6 (Login Program with sqlite database) he sends the query to the 'table'. Its name is 'EmployeeInfo'.
    I got the error because I sent the query to 'EmployeeData' rather than to 'EmployeeInfo" when following this tutorial. It doesn't throw up errors anymore after I changed that.
    Gotta thank Ravish Kumar here in the comments section. His comment is what helped me realize my mistake.

  • @diegomartinezolvera4056
    @diegomartinezolvera4056 9 місяців тому

    Thanks 👍👍

  • @ProgrammingKnowledge
    @ProgrammingKnowledge  10 років тому +1

    • @nissimohana223
      @nissimohana223 9 років тому +1

      Thanks a lot for your understund lessons

  • @erouse666
    @erouse666 10 років тому +4

    Mostly good info but some bad practices shown here. Put the initial PreparedStatement pst = null; outside the try so you can close it in the finally. Same with the ResultSet rs. Always check for null before you try and close. Always, always, always close in a finally. In a single user standalone app in might not matter, but if you expect more than that, a failed query could prevent closing and, in the case of sqlite, lock you out of the database until everyone closes the app.

  • @AmrShriefIGOR
    @AmrShriefIGOR 8 років тому +1

    you are awesome!

  • @venkat2324
    @venkat2324 9 років тому

    thanks a lot sir

  • @Snyoreetaaa
    @Snyoreetaaa 6 років тому

    Thank you !!

  • @something......something3844
    @something......something3844 8 років тому

    guys,java.lang.null pointerexception is resolved declare jtext field and jpassword field once in the class instead of twice at connection or at class level

  • @jennyshah2922
    @jennyshah2922 7 років тому

    informative tutorial sir but i got error at null pointer exception at end can you guide me ?

  • @yahoo0593
    @yahoo0593 9 років тому

    thanks!

  • @78501
    @78501 8 років тому +2

    how do i get it work with .getPassword instead of .getText ? if i use getPassword i get errors about the getString.

  • @xxgunnery
    @xxgunnery 7 років тому

    Found a solution to { no such table }. If you followed this tutorial and chose to use a program like "DB Browser for SQLite", then you will have to click "Write Changes" which will save the handmade changes that you did to the database. Before you save it, the table which you created has not been saved to your directory and will not be found.

  • @tigermayger3575
    @tigermayger3575 8 років тому

    Hello ProgrammingKnowledge thank you so much for sharing your expertise with us all! Just tried the same steps, getting the secure connection though hitting this error thereafter: [java.sql.SQLException: not implemented by SQLite JDBC driver] please help!

    • @emerlander
      @emerlander 7 років тому

      [Solved]
      Like the others here I had the same error. Here's the solution: Let's keep in mind two things here. First he creates a database. He names it 'EmployeeData'. He then creates a table within that database. He names it 'EmployeeInfo'. In tutorials #3 and #4 (Data Connection) he gives connection to the 'database'. Its name is 'EmployeeData'. In tutorials #5 and #6 (Login Program with sqlite database) he sends the query to the 'table'. Its name is 'EmployeeInfo'.
      I got the error because I sent the query to 'EmployeeData' rather than to 'EmployeeInfo" when following this tutorial. It doesn't throw up errors anymore after I changed that.
      Gotta thank Ravish Kumar here in the comments section. His comment is what helped me realize my mistake.

  • @5LikeYouC
    @5LikeYouC 9 років тому

    At 9:57 (after your disconnect) you commented lines 95 and 96 (rs.close() and pst.close()), so because of that prg throws NullPointerException. May you tell me where i need to close all of three streams (connection, rs and pst)?

  • @RameezSafdar
    @RameezSafdar 8 років тому

    LOL, The surname of first entry in Database is boner xD btw good tutorial :)

  • @OvidiuMoldovan1602
    @OvidiuMoldovan1602 7 років тому +1

    For the Null Pointer Exception I added in the try block "Connection conn = sqliteConnection.dbConnector(); PreparedStatement pst = conn.prepareStatement(query);".

  • @johnwelamador5759
    @johnwelamador5759 8 років тому +4

    I followed every step but im getting java.nullpointer exception blabla. huhu/ why

    • @emerlander
      @emerlander 7 років тому +2

      [Solved]
      Like the others here I had the same error. Here's the solution: Let's keep in mind two things here. First he creates a database. He names it 'EmployeeData'. He then creates a table within that database. He names it 'EmployeeInfo'. In tutorials #3 and #4 (Data Connection) he gives connection to the 'database'. Its name is 'EmployeeData'. In tutorials #5 and #6 (Login Program with sqlite database) he sends the query to the 'table'. Its name is 'EmployeeInfo'.
      I got the error because I sent the query to 'EmployeeData' rather than to 'EmployeeInfo" when following this tutorial. It doesn't throw up errors anymore after I changed that.
      Gotta thank Ravish Kumar here in the comments section. His comment is what helped me realize my mistake.

  • @rafaelfonseca4242
    @rafaelfonseca4242 4 роки тому +2

    anyone can help me? i do all things of video and my program have a error

  • @TryHardGoPro
    @TryHardGoPro 7 років тому +1

    if run program they always show username and pass word is not correct....why my program does not show any error...why will happen explain it ....please sir

    • @ujjwalsomani1982
      @ujjwalsomani1982 6 років тому

      Ambesh Vishwakarma i also have same problem .Did u fix it

  • @shishiraithal308
    @shishiraithal308 4 роки тому +1

    im getting java.lang.SQLException error pls help

  • @Itssilver1
    @Itssilver1 9 років тому +3

    when im clicking on Login button im getting this error java.lang.NullPointerExcepetion can you help me ? :/

    • @raulsanchez8460
      @raulsanchez8460 9 років тому +1

      +Argjend Bytyqi Did you ever figure out what's wrong? I have the same error.

    • @Itssilver1
      @Itssilver1 9 років тому

      +Iker Sanchez no man still and i didnt search anymore im working in something else but if i will find something ill tell you :)

  • @uniquedevotion2872
    @uniquedevotion2872 4 роки тому +2

    Username and Password is always incorrect. I have a connection and the username and passwords are correct. What could the possible solution be?

  • @jeawonkwon8761
    @jeawonkwon8761 7 років тому +3

    Did u tell us how to mask the password?

    • @pjotordona
      @pjotordona 7 років тому +1

      He uses JPasswordField instead of JTextField.

  • @amareshsahoo320
    @amareshsahoo320 6 років тому

    hello sir,there is one problem , when i chick on the login button without entering any username & password then it will also login sucessfully where as username & password is empty bt it showing login sucssfully.Plz fix this problem.Hope u must reply me.

  • @beeyouteafool9561
    @beeyouteafool9561 5 років тому

    In my program, while(rs.next() ) loop isn't getting executed. Pls helpp

  • @ramasaha1965
    @ramasaha1965 7 років тому

    Sir, I done the same... but it's shows "java.lang.nullpointerexception"... how do I fix it???....hepl me

  • @rest-of-the-world
    @rest-of-the-world 9 років тому

    Use pst.setString(1,textFieldUN.getText().toLowerCase());
    You need .toLowerCase(); for username.

    • @Quantummmm
      @Quantummmm 8 років тому

      +abdullayeff You do not need lowercase.

    • @rest-of-the-world
      @rest-of-the-world 8 років тому

      +XQuantumForceX object.equals("user","User") == false. So you need lowercase for username area.

  • @jamessip1088
    @jamessip1088 4 роки тому

    I've figured out the username and password both being correct but the app says they are incorrect error. Make sure when you make the count statement, to make it count = count + 1. Don't follow his advice to make the statement count = count++. Count would equal 0 and wouldn't be incremented when one tries to log in.

  • @patrickedwinmoran2966
    @patrickedwinmoran2966 6 років тому

    Clicking for tutorial #9 I come to tutorial #6. Where did #9 go? Does anybody know?

  • @alamisoufiane3588
    @alamisoufiane3588 7 років тому

    I followed every step but i got null pointer exception how do I fix it ? I

  • @princesspiem5901
    @princesspiem5901 5 років тому

    I am facing arrayoutofbound exception

  • @David-vf1qf
    @David-vf1qf 6 років тому

    Can you post sqliteConnection.java please?

  • @aditirajendran4158
    @aditirajendran4158 8 років тому +1

    when i login i get this exception:
    java.sql.SQLException:[SQLITE_ERROR]SQL error or missing database (no such such table : EmployeeInfo )

    • @vishalmoradiya1820
      @vishalmoradiya1820 8 років тому

      +Aditi Rajendran me too...any solution you have goted?

    • @Diego-cz7cl
      @Diego-cz7cl 8 років тому +1

      +vishal moradiya If you still need it, the solution for me was to use the name you gave to the table in sqlite not the file name

    • @wearetorqueaddicts
      @wearetorqueaddicts 8 років тому

      +Diego Chui what do you mean?

    • @emerlander
      @emerlander 7 років тому

      Thanks a lot, man. Your comment is the one that made me realize what I had to do to fix it. I've mistakenly credited to another dude here in the comments. Forgive me! Haha

  • @jamessip1088
    @jamessip1088 4 роки тому

    I've followed the whole video and it keeps telling me that the username and password are wrong. I've tried like everything. any suggestions? Thank you

  • @itsmepapscarlo4761
    @itsmepapscarlo4761 8 років тому

    I follow your step in doing the program but but i got some error like this ( java.sql.SQLException:[SQLITE_ERROR]SQL error or missing database (near"_";syntax error ? help me plss ...

    • @RavishKumar-ns3gh
      @RavishKumar-ns3gh 8 років тому +1

      Please check ur table name ......beacuse i was facing the same errror there was a mistake in my table name speling.

    • @nithinclukose5388
      @nithinclukose5388 8 років тому

      i am getting "java.lang.ClassNotFoundException :org.sqlite.JDBC" can anyone help me

    • @emerlander
      @emerlander 7 років тому

      [Solved]
      Like the others here I had the same error. Here's the solution: Let's keep in mind two things here. First he creates a database. He names it 'EmployeeData'. He then creates a table within that database. He names it 'EmployeeInfo'. In tutorials #3 and #4 (Data Connection) he gives connection to the 'database'. Its name is 'EmployeeData'. In tutorials #5 and #6 (Login Program with sqlite database) he sends the query to the 'table'. Its name is 'EmployeeInfo'.
      I got the error because I sent the query to 'EmployeeData' rather than to 'EmployeeInfo" when following this tutorial. It doesn't throw up errors anymore after I changed that.
      Gotta thank Ravish Kumar here in the comments section. His comment is what helped me realize my mistake.

    • @emerlander
      @emerlander 7 років тому

      Bro, thanks a ton! You helped me figure out why I was getting the error. Phew!

  • @christiancabalar9124
    @christiancabalar9124 6 років тому

    help me how to fix java.lang.NullPointerException ?? anyone??

  • @computerbolter4079
    @computerbolter4079 6 років тому

    I have followed your steps sir, but my wrong username and password is also shown as valid. Please help me.