Skip to content
Advertisement

How to implement a JDBC database into a Gui program to authenticate a user and password for logging into the program

I’m currently making a gui program and I’m clueless to how I am meant to set up my program so when the user inputs a username and password, and then clicks the login button it checks the database for the username and password, and if the username and password is in the database, they accepted, if not declined.

This is my Welcome screen, its bad at the moment I plan to tidy it up.

JavaScript

When I click existing user it takes me to the login panel which is :

JavaScript

I’ve set up a JDBC in netbeans and have added tables with username and password and filled the tables up with mock up usernames and passwords, I also want to make it when they click new user they can add new information to the database so that they can long in with the new account.

Below is my JDBC

JavaScript

Advertisement

Answer

This is a small piece of code that is used for checking username and password and this is for mysql database

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement