Powered by Blogger.

Wednesday 28 January 2015

DataBase Connection

No comments :
Desktop Application Login form connect with MySql and Open NetBeans See The Menu Bar go to the file Menu Click on the New Project(Ctrl+Shift+N) and Select Left site categories JAVA and Project categories to Right Site Project Java Application .You have to give The Program Name "FirstMysqlLogin". if you wont to save Project Location you can Browse and File save on the direction place and Gone a default Place and Now uncheck the Main Class and then press the Finish button.you can see the project Status.
When you click left site Project Node and Right Click to the sub Source package Node go to the Jframe Form file.Next you have to give the Class Name as "FirstMysqlLogin" and Source Name as "firstmysqllogin" .click Finish. You have go to the Libraries Node Right click in the Libraries in project folder and select Add librabries->Import Mysql Driver.
When you have go to the Windows->Services. Select the Database Node and right click Mysql Serve Choose the start the MySQL database server by expanding the Databases node in the Services window, right-clicking the MySQL Server node and choosing Start.Select and right-click the MySQL Server node and choose Create Database menu.Select the demoregister database from the New Database Name drop down list in the Create MySQL Database dialog box.
You have Create Table right click choose the create table.Next you have to give Table name as Login and Add column first column name is username and Second column name is Password and give to the Storage variable Type.
Open Jframe file Name is FirstLoginForm and Design to Login Form .
Implement Login & Reset  Button code

Database Connection Code:

You have open Mani java class is FirstMysqlLogin and when you call the class file is FirstLoginForm.


Output: