Belajar Java Pemula : Netbeans Multi Login Form User MySQL Md5 password

Tutorial Belajar Java Pemula : Netbeans IDE java cara membuat login form multi user menggunakan database MySQL dan MD5 Password Java khusus pemula, tutorial java selengkapnya di sector code

Belajar Java - Bagaimana cara membuat koneksi java di Netbeans dan membuat login form dengan multi user (Hak akses) berbeda menggunakan database MySQL dengan format password MD5? tutorial java kali ini akan membahas cara sederhana membuat login administrator di java, ikuti terus tutorialnya ya.

Tutorial terkait :
Tutorial Java : Membuat Koneksi Database MySQL JDBC Driver pada Java Netbeans
Video Tutorial CRUD (Create,Read,Update,Delete) Java JDBC Database MySql

Membuat Login Form Java

Buatlah project baru pada Netbeans kamu beri nama "JavaAplikasiLogin" dan buat Class baru dengan nama "Connections", class connections ini berguna untuk membuat koneksi java ke database yang sudah kamu siapkan sebelumnya,

Untuk class connecions silahkan tuliskan code java berikut :
import java.sql.Connection;
import java.sql.DriverManager;
import javax.swing.JOptionPane;

public class Connections {
    private static Connection mysqlconnect;
    public static Connection OpenDB(){
        String database = "jdbc:mysql://localhost:3306/nilai_akademik"; // ini adalah nama database kamu
        String user = "root";
        String password = "";        
        //you must have a database before (MySQL database)
        // i was have database        
        if (mysqlconnect==null) {
            try {
                DriverManager.registerDriver(new com.mysql.jdbc.Driver());
                mysqlconnect = (Connection) DriverManager.getConnection(database,user,password);
            } catch (Exception e) {
                JOptionPane.showMessageDialog(null,"Connection Failed !");
            }
        }        
        return mysqlconnect;
    }
}
Selanjutnya buat Form login java dengan jFrame Form Netbeans kamu, dan desainlah tampilan login kamu seperti gambar dibawah ini

Jika sudah selesai, klik pada JButton1 dan tuliskan code java berikut :
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        try {
            Connection conn = (Connection) javamultiloginform.Connections.OpenDB();
            java.sql.Statement stm = conn.createStatement();
            java.sql.ResultSet rs = stm.executeQuery("SELECT * FROM akun_guru WHERE username='"+ jTextField1.getText() +"' AND password=MD5('" + jPasswordField1.getText() + "')");
            if (rs.next()) {
                if ("1".equals(rs.getString("typeuser"))) {
                    // its for login user type 1 (Administrator)
                    JOptionPane.showMessageDialog(null," Wellcome Administrator");
                    // do something else for user 1
                } else if ("0".equals(rs.getString("typeuser"))) {
                    // its for user 2 (TU)
                    JOptionPane.showMessageDialog(null," Welcome TU !");
                } else {
                    //do anything you want !
                }
            } else {
                // its for if login filed
                JOptionPane.showMessageDialog(null," Login Filed ! !");
            }
        } catch (Exception e) {
        
        }        
    }
Jika sudah selesai maka kamu sudah berhasil membuat login form java dengan multi aksess user, coba jalankan aplikasi java kamu sekarang, jika masih kesulitan tinggal lihat video tutorialnya dibawah ini :

Video Tutorial Java Khusus Pemula : Belajar membuat Form Login dengan Netbeans IDE 



Tutorial ini boleh anda sebarkan dengan mencantumkan sumber aslinya,

Untuk mendapatkan informasi-informasi menarik lainnya silahkan join dengan kami di :

Google Plus : https://plus.google.com/+HarisonMatondang
Youtube Channel : http://www.youtube.com/c/HarisonMatondang

Next Recomended


Feel free to code it up and send us a pull request.

Hi everyone, let's me know how much this lesson can help your work. Please Subscribe and Follow Our Social Media 'kodeajaib[dot]com' to get Latest tutorials and will be send to your email everyday for free!, Just hit a comment if you have confused. Nice to meet you and Happy coding :) all ^^



Follow by E-Mail


Name

ADO.NET,3,Ajax,6,Android,9,AngularJS,4,ASP.NET,4,Blogger Tutorials,7,Bootstrap,7,C++,1,Codeigniter,2,Cplusplus,6,Crystal Report,6,CSharp,25,Ebook Java,2,FlyExam,1,FSharp,3,Game Development,2,Java,35,JDBC,2,Laravel,84,Lumen,2,MariaDB,2,Ms Access,3,MySQL,31,ODBC,6,OleDB,1,PHP,14,PHP Framework,5,PHP MYSQLI,9,PHP OOP,5,Python,8,Python 3,4,SQL Server,4,SQLite,4,Uncategorized,5,Vb 6,2,Vb.Net,89,Video,48,Vue Js,4,WPF,2,Yii,3,
ltr
item
KODE AJAIB: Belajar Java Pemula : Netbeans Multi Login Form User MySQL Md5 password
Belajar Java Pemula : Netbeans Multi Login Form User MySQL Md5 password
Tutorial Belajar Java Pemula : Netbeans IDE java cara membuat login form multi user menggunakan database MySQL dan MD5 Password Java khusus pemula, tutorial java selengkapnya di sector code
https://2.bp.blogspot.com/-tyThMkMwsig/VuLq_poRqvI/AAAAAAAABVo/OUB4ooFqSMgdEbHI0FhZDiYPzcrGyP16Q/s320/java-login-form.jpg
https://2.bp.blogspot.com/-tyThMkMwsig/VuLq_poRqvI/AAAAAAAABVo/OUB4ooFqSMgdEbHI0FhZDiYPzcrGyP16Q/s72-c/java-login-form.jpg
KODE AJAIB
https://www.kodeajaib.com/2016/03/belajar-java-pemula-netbeans-login-form.html
https://www.kodeajaib.com/
https://www.kodeajaib.com/
https://www.kodeajaib.com/2016/03/belajar-java-pemula-netbeans-login-form.html
true
3214704946184383982
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy