Create Table of Programs With Language Programs Java and MySql

in #programming7 years ago

Hello friends, today I posted again about programming, today I post coding to create Table Program using Java Programming Language, in this section I will share some of the java coding science I have ever made, The application I made is very simple, I make coding manually, the database I use is mysql.


MAKE TABLE DEPARTMENT

Design form Employee table using jlabel to create label, TextFiel to input data, and jTabel1 For input entry into table, and Button to save, Edit, And delete that seen in picture above.

Next continue with the syntax of the top program first


• For Button Save
• Right click on Button1 ➔ Event ➔ Action ➔ ActionPerformed

• For Clear Button
• Right click on Button3 ➔ Event ➔ Action ➔ ActionPerformed

• For Button Back
• Right click on Button9 ➔ Event ➔ Action ➔ ActionPerformed

• To Edit Button
• Right click on Button2 ➔ Event ➔ Action ➔ ActionPerformed

❖ If databases In NETBEANS connect with Mysql the way is:
❖ Right click on Libraries ➔ Select add Library ➔ Mysql JDBC Driver

The analysis: when we press the run button if connected with Mysql it will appear in the output Driver found.and if belom connected to eat Driver bel d d find.

Connection Program Analysis


In this program code import javax.swing and java..sql. In the Database Connection method that does not have a return type this value uses a try, catch control structure similar to if ... else. This control structure is used for database connections. We can see in the program code inside Try to configure the jdbeodbeDriver we created earlier with the name Databases Restaurant, password "root" to test connection here using JoptionPane help to display it. If the connection fails then a dialog box will show the connection connection with the contents of the failed connection as the program code below:

Analysis :


In this program code is a declaration of variables consisting of string, integer, defaultTableModel and connection


UPVOTE & RESTEEM

FOLLOW ME @muchsin

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 62852.17
ETH 2463.87
USDT 1.00
SBD 2.64