Java JDBC Tutorial - Part 12.6: Connect Java Swing GUI to a MySQL Database - Create a Form to Add

preview_player
Показать описание

---

---

In this video we will learn how to to connect a Java GUI to a MySQL database. We will create a form to add data into the database.
Рекомендации по теме
Комментарии
Автор

it's been almost 7 years and you taught me more in a couple of minutes than my teacher in 2 weeks, you saved my first project. Thanks a lot!

Yoggan
Автор

Best tutorials series about JDBC! Thank you !

bogdanspirea
Автор

Thank you for excellent tutorial. It's really helped me to understand how display data inside JTable component.

MichaelTLT
Автор

Thank you very much, your tutorial videos are great!!!!

techrodeepzone
Автор

Hi Chad, Thanks for the video. I cant find the code on your site. Thanks

awekayode
Автор

Great vids, but sir, can i be able to change the swing redesign after copying the source code and paste?
And just out of curiosity, is this how you always talk or its just a matter of tutorials, cause you really sound like some programmed talking robots, which is amazing coz you so fluent

mphoallen
Автор

thank you for tutorial man. it's helped me a lot but i have a problem. when i click add button, jdialog appears at the top left of the screen with a small icon. even i resize it nothing display. can you please help me?

kutanulgen
Автор

Hi thanks for the series it has been beyond helpful. I am currently on part 12.6 running java version "1.8.0_45" and using Eclipse Mars 4.5 on a mac. I have gone as far as making everything as vanilla as I can and I get the following error when I click the button to add employee. 

Exception in thread "AWT-EventQueue-0"

could you point me in the right direction to look up how to fix the issue? Hope all is well and thanks for any guidance you can provide.


ADDED NOTE: in my AddEmployeeDialog.java the code generated for public AddEmployeeDialog() { ... contentPanel.setLayout ... } is FormSpecs. instead of your example code FormFactory. Wonder if that is making the difference?


I also wonder if this is a Java 1.8 issue??? Just a thought. Thanks for all you do.


FINAL NOTE: (I promise) I used GridBagLayout instead and it worked. Thanks again!!!

therandomlifeofbrian
Автор

This is awesome tutorial, please help me to download source code, link which is appeared in the video is not working, anyone can provide the valid link

SuchithGunarathna
Автор

Thanks for this video. I was kinda on the right track with the prepared statements. I tried to get the source code from the description, but it just takes me to a blog. Is the source code somewhere in the blog or am I missing it?

ViaVanille
Автор

Hello luv2code your JDBC tutorial series just wow currently now i am watching u'r Part 12.6 Connect Java Swing to a MySQL Database - Create a Form to add. after completed this tutorial i faced one problem which is when i click my add new employee button the compiler show me this Exception


Wed May 18 21:33:33 BDT 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Database Connected
Exception in thread "AWT-EventQueue-0"
at
at
at
at
at
at
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Method)
at Source)
at Source)
at Source)
at Source)
at Method)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
Caused by:
at Source)
at Source)
at Source)
at Source)
... 42 more

What can i do now can you tell me plz????

AbdurRazzaqMirr
Автор

Hello Darby, when i click my button Submit which is your Save button it gives an error - Error saving public volunteer - null. May i ask why is that so?

And may i know how to save data from a form with checkbox, radiobutton and comboBox?

cinimodmil
Автор

Also, the database I am working with has four tables. My question is this: Does a DAO need to be created for each table?? And also I have two columns that need to have values be autogenerated as well...which I am confused as to how to go about that. For example, whenever i add a new person to my database, each person will have an ID generated automatically assigned to them. Any help would be greatly appreciated.

ViaVanille
Автор

Never mind I found and fixed the error on my own :D

engineerali
Автор

hi sir, i am just a beginner on java. When I click Save. It keep popping error message. Whats is wrong with my coding or is just some library missing?

ojisanpass-by
Автор

Hi, i'm following every step but i cannot create an Object employee in the AddEmployeeDialog. I have the error : Employee cannot be resolved as a type ? any idea how to solve it ?

MalikCx
Автор

Hello Sir Chad
Hope you're doing good.

I am in the middle of your tutorials and really learning a lot out of those day by day so thanks a bunch for your efforts.

While I was going through this video, I have got 2 places in the AddEmployeeDialog.java file where the eclipse shows errors and throws exceptions on Save Employee button.

Following are the 2 locations of errors:

1. import //here it says the import cannot be resolved

2. And i think because of this it starts marking errors on all the lines where we are calling and other lines of FormFactory....

Can you please help me out of these errors. I have not made any changes to the code that you provided. Just copy and paste.

Thanks in advance for your time and support.

syednoman
Автор

Hii! I'm Lorenzo I'm a great fan of yours and I actually learn a lot from your videos, these past few days I'm trying to create some program and thanks to you i'm halfway done, but there is a slight problem, when creating an account (From different UI, Not from the searchTable) there is an error message when Creating an Account from different UI. Can you help me with this one sir?

LorenzoEnzooey
Автор

hi chad. i have a problem when it comes to add a new record. i get and error saving employee: null. Where could the problem be.

edwinmwangi
Автор

I get an error here : 
Employee tempEmployee = new Employee(lastName, firstName,
email, salary);
The constructor Employee(String, String, String, Int) is undefined.
Salary is Int, not BigDecimal.

ionutlaurentiuresnoveanu