Java and JDBC tutorial #1: Make connection

preview_player
Показать описание
If you have any question, leave it in comment section below.

Download links (Yes, you will have to register.):

Рекомендации по теме
Комментарии
Автор

Thank you so much for the excellent tutorial! I can't wait to learn from your other tutorials, as well. I have a lot of experience with SQL using command line access, but wanted to give writing Java Apps a try, too. Unfortunately, I am brand new to Java, having coded in C/C++ and Python for most of my experience, but your tutorial was FANTASTICALLY clear. Thank you again--much appreciated!!

(It was also a nice coincidence that you use IntelliJ in this tutorial, as I had just installed it and was trying to figure my way around the IDE. I actually like it so far, but again, I am brand new to Java and have neither used Netbeans nor Eclipse. Thanks again.)

laraansari
Автор

Awesome explanation. I'm new to java and your tutorials are perfect gem. Thanks a lot.

vadirajjahagirdar
Автор

Thank you so much.
Simple, easy and excellent tutorial.

vadirajjahagirdar
Автор

Oh, thats very easy. You can load your properties file as resource bundle: ResourceBundle bundle = //Don't put .properties extension after filename

To retrieve specific property from your properties file (for example you have driver property: String driver = bundle.getString("driver");
Good luck!

OverG
Автор

I'm just trying out Intellij. I really really love its intellisense. And its suprisingly fast, considering it uses swing for GUI. But I find this community version useless for dynamic web projects. Maybe one day I buy a ultimate version.. So for now, my major IDE for Java projects is still Eclipse.

OverG
Автор


Thank you OverG88
I will keep watching for asking.
Even no speaking English I understood the tutorial.
See you.

aleksandertomaz
Автор

Cool, thanks for the reply. I think I'm going to stick to Eclipse for now.

scraper
Автор

Which IDE do you like better. Eclipse or intelliJ? I remember you used to use Eclipse in previous tutorials. What made you change?

scraper
Автор

Class Properties? You mean file .properties to store driver, password and user values?

OverG
Автор

can i use sql server to create database instead of mysql ?!

Elaq_Maloma
Автор

Why you have added auto_increment ? I'm asking as my compiler kicks me out cause of it...

vladeb
Автор

How I could use a class Properties for driver, password and user?
Thanks a lot!

aleksandertomaz
Автор

Im having bulk of errors in my program. I did exactly how you explained and showed. The error is like this:
"C:\Program "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Files\JetBrains\IntelliJ IDEA 2018.1.5\bin" -Dfile.encoding=UTF-8 -classpath App
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at
at
at
at
at
at
at
at
at
at App.main(App.java:11)
Caused by: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at Method)
at
at
at
at
at
at
at
at
at
at
at
... 7 more
Caused by: java.net.ConnectException: Connection refused: connect
at Method)
at
at
at
at
at
at
at
at
at
... 10 more

urmishah
Автор

Oh! Yes, that's right, Sorry me.
Obrigado = thanks

aleksandertomaz
Автор

what should i do if i dont have test database??

sarwarjahan