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
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
26 responses to “Java NetBeans Tutorial: Connecting to a MySQL Database with Java, JDBC and NetBeans”
wow that's perfect ! Thanks a lot !
it's not allowing to copy paste jar file in files.
it is possible to connect an android app with this netbeans and database and access data from database through netbeans
thanks a lot! cheers from Ecuador
3:10 Choose (as you did) "Add JAR/ Folder, not "Add Library" (as you said)
hey I have this problem… even though I include the jar file I still get the ClassNotFoundException. How can I fix this? Thank you.
One of the Best online YouTube teachers! Thanks for the video.
thank u so much bro…netbeans connect ho gya mysql se
Chad, thank you very much for this wonderful and easy to follow tutorial…. Keep on sharing…
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.
Thanks a lot for this top Tutorial!
that's it…..OMG mysql_connector was missing all the time for me
thx u SIR
why you have not used class.ForName
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?
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
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 🙁
Hi sir, very good tutorials. Thank you so much..
How to write a separate class function for reterving the data from table of a database and displayed in a separate jsp page/file ??
how to "paset java jdbc" file in windows?
Hello sir, thank you for this tutorial.
finally it's work… i have been trying this for a long time so thank you for this great video 🙂
Hello sir, i can't acces to the link that you gave on the video.
thank you so much, i was looking for this tutorial
Thanks a lot sir, its working, I've been trying this for a long long time.
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.
:* :* <3 <3 Thank you