|
1 | | -# Simple-Login-Java-MySQL |
2 | | -Pop up of a small login window which connects to a local mysql database to see if the login can be concluded or not. |
| 1 | +# Simple Login App With Java and MySQL |
| 2 | + |
| 3 | +A Java MySQL app which pops up of a small login window. This window connects to a local mysql database to see if the login can be concluded or not. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +# About this Project |
| 8 | + |
| 9 | +This project's goal is to create a simple login app on which the user can enter the *username* and *password* and click login buttom. If *username* and *password* are in the database, then a message dialog will pop up and yell the success; else, another message dialog will pop yelling the failure. |
| 10 | + |
| 11 | +# Getting Started |
| 12 | + |
| 13 | +**Prerequisites** |
| 14 | + |
| 15 | +To run this project, you'll need to have a basic environment to run a Java, MySQL App. |
| 16 | + |
| 17 | +**Installing** |
| 18 | + |
| 19 | +Cloning the Repository |
| 20 | + |
| 21 | + $ git clone https://github.com/awcasella/Simple-Login-Java-MySQL.git |
| 22 | + |
| 23 | + $ cd Simple-Login-Java-MySQL |
| 24 | + |
| 25 | +Installation of XAMPP for MySQL and Java |
| 26 | + |
| 27 | +- XAMPP installation tutorial can be found in [here](https://www.edivaldobrito.com.br/como-instalar-o-xampp-no-linux/). |
| 28 | + |
| 29 | +- ORACLE Java installation tutorial can be found [here](https://www.edivaldobrito.com.br/oracle-java-no-ubuntu-18-04-lts/). |
| 30 | + |
| 31 | +Run project |
| 32 | +Open XAMPP and start MySQL Database and Apache Web Server. |
| 33 | + |
| 34 | +<p align="center"> |
| 35 | + <img width="531" height="375" src="ScreenshotXAMPP.png"> |
| 36 | +</p> |
| 37 | + |
| 38 | +After that, open the terminal and start MySQL |
| 39 | + |
| 40 | + $ mysql -u root -p |
| 41 | + |
| 42 | +Configure local database to be connected by our app: |
| 43 | + |
| 44 | + > create database if not exists login; |
| 45 | + |
| 46 | + > create table if not exists login( |
| 47 | + username VARCHAR(15) PRIMARY KEY, |
| 48 | + password VARCHAR(15) NOT NULL, |
| 49 | + email VARCHAR(25) NOT NULL, |
| 50 | + fname VARCHAR(15) NOT NULL, |
| 51 | + lname VARCHAR(15) NOT NULL, |
| 52 | + ); |
| 53 | + |
| 54 | + > insert into login values ('jdoe', '2020', 'jdoe@domain.com', 'John', 'Doe'); |
| 55 | + |
| 56 | +**Note:** It is imperative to create a table named 'login' with the columns named 'username, password, email, fname, lname'. Otherwise, either the program will throw an exception or you'll have to change the code lines to make it compatible with the database. |
| 57 | + |
| 58 | +Open NetBeans (or other IDE) and run the project. Make sure the file MySQLTest.java is the main file of the project. |
| 59 | + |
| 60 | +<p align="center"> |
| 61 | +<img width="400" height="400" src="Screenshotjdoe.png"> |
| 62 | +</p> |
| 63 | + |
| 64 | +# Built With |
| 65 | +- [NetBeans](https://netbeans.org): Fits the pieces together. |
| 66 | + |
| 67 | +- [MySQL](https://www.mysql.com): The world's most popular open source database. |
| 68 | + |
| 69 | +- [XAMPP](https://www.apachefriends.org/pt_br/index.html): Installers and Downloaders for Apache Friends. |
| 70 | + |
| 71 | +# References |
| 72 | +- Interfaces gráficas com Swing. Caelum. Available at: [https://www.caelum.com.br/apostila-java-testes-xml-design-patterns/interfaces-graficas-com-swing/](https://www.caelum.com.br/apostila-java-testes-xml-design-patterns/interfaces-graficas-com-swing/). Access on January, 2020. |
| 73 | + |
| 74 | +- Java Swing: Conheça os componentes JTextField e JFormattedTextField. DevMedia. Available at: [https://www.devmedia.com.br/java-swing-conheca-os-componentes-jtextfield-e-jformattedtextfield/30981](https://www.devmedia.com.br/java-swing-conheca-os-componentes-jtextfield-e-jformattedtextfield/30981). Access on January, 2020. |
0 commit comments