• Saturday , 18 November 2017

Java NetBeans Tutorial: Connecting to a MySQL Database with Java, JDBC and NetBeans

Code Canyon



Download Java Source Code: http://www.luv2code.com/?p=992 In this video you will learn how to connect to MySQL with Java and NetBeans. Please subscribe …

Original source

3d Ocean

Related Posts

26 Comments

  1. MeGaMoV
    September 8, 2017 at 21:35

    wow that's perfect ! Thanks a lot !

  2. Hardik Patil
    September 8, 2017 at 21:35

    it's not allowing to copy paste jar file in files.

  3. Bhagyasree Surendran
    September 8, 2017 at 21:35

    it is possible to connect an android app with this netbeans and database and access data from database through netbeans

  4. Jorge Peralta
    September 8, 2017 at 21:35

    thanks a lot! cheers from Ecuador

  5. Red Bear
    September 8, 2017 at 21:35

    3:10 Choose (as you did) "Add JAR/ Folder, not "Add Library" (as you said)

  6. Josiah Tobas
    September 8, 2017 at 21:35

    hey I have this problem… even though I include the jar file I still get the ClassNotFoundException. How can I fix this? Thank you.

  7. Josiah Tobas
    September 8, 2017 at 21:35

    One of the Best online YouTube  teachers! Thanks for the video.

  8. muhammad salman
    September 8, 2017 at 21:35

    thank u so much bro…netbeans connect ho gya mysql se

  9. Vicente Calag
    September 8, 2017 at 21:35

    Chad, thank you very much for this wonderful and easy to follow tutorial…. Keep on sharing…

  10. Cariboo Land
    September 8, 2017 at 21:35

    Thank you very much, it was exactly what I was looking for to solve a problem with connection to a firebird database. I think that this tuto will be useful at least beginners.

  11. Adrian Fuhrer
    September 8, 2017 at 21:35

    Thanks a lot for this top Tutorial!

  12. Dj Dan
    September 8, 2017 at 21:35

    that's it…..OMG mysql_connector was missing all the time for me
    thx u SIR

  13. akshat soni
    September 8, 2017 at 21:35

    why you have not used class.ForName

  14. Fitian A
    September 8, 2017 at 21:35

    thanks for ur knowledge,
    i got this red messages after i run the program
    ((com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ''@'localhost' to database 'demo'))? therefore i cant connect to my server!!
    any idea why bro?

  15. Troy Ong
    September 8, 2017 at 21:35

    PLEASE HELP! I received this error:

    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
    at java.sql.DriverManager.getConnection(DriverManager.java:664)
    at java.sql.DriverManager.getConnection(DriverManager.java:247)
    at esd.JDBC.main(JDBC.java:31)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
    … 15 more

  16. Parsa Zarrin
    September 8, 2017 at 21:35

    Hey Sean,

    I have an issue with my own program I made for my school,
    it uses  Java DB and JPC. Whenever I try to code to make it get data to my normal login application and my questionnaire(for tests in schools) it has an error saying this:

    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code – Erroneous sym type: com.pluralsight.DBManager.setVisible
     at com.pluralsight.DBManager.main(DBManager.java:60)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 second)

    I know it sounds stupid trying to show the DB to the application but I am terrible at  SQL and did a bit of NetBeans coding to it store the name's in the program.
    Please help 🙁

  17. Sunil Kumar Singh
    September 8, 2017 at 21:35

    Hi sir, very good tutorials. Thank you so much..

  18. Aswathi C.R
    September 8, 2017 at 21:35

    How to write a separate class function for reterving the data from table of a database and displayed in a separate jsp page/file ??

  19. Bhanuka Isuru
    September 8, 2017 at 21:35

    how to "paset java jdbc" file in windows?

  20. Djelouahi Sidali
    September 8, 2017 at 21:35

    Hello sir, thank you for this tutorial.

  21. Yasser DX
    September 8, 2017 at 21:35

    finally it's work… i have been trying this for a long time so thank you for this great video 🙂

  22. Jr Morales
    September 8, 2017 at 21:35

    Hello sir, i can't acces to the link that you gave on the video.

  23. Hamza Ahmad
    September 8, 2017 at 21:35

    thank you so much, i was looking for this tutorial

  24. Victoria Irene
    September 8, 2017 at 21:35

    Thanks a lot sir, its working, I've been trying this for a long long time.

  25. peraruor
    September 8, 2017 at 21:35

    Thanks, you'r way to explain is very simple and to the point. It's easy to follow and I don't fill I'm wasting my time. You'r code works great! I use you'r example code but with "try with resources" so you don't need code to close the data base, Java will do it for u. Thanks again.

  26. Kaveri Gojare
    September 8, 2017 at 21:35

    :* :* <3 <3 Thank you

Leave A Comment

You must be logged in to post a comment.