After clean and build in netbeans.The jar file won't connect with the database(MySQL) .My project works perfectly well while still in the IDE . how do I solve this problem so I can install my software into another machine.
What does "won't connect" mean? Are there any error messages or exceptions? If so, post the full stack trace (assuming that the code hopefully does not ignore exceptions). Are all required libraries in the classpath, expecially the JDBC driver?
posted 1 year ago
Thank you for replying.It means when I run my project in Netbeans , it communicates with the MySQL database.For example, a list of names in the database can be loaded into a combo box. But when I run my project using the executable jar file which Netbeans prepares,this process does not happen.It's like there's no connection between my software and the database..
I have attached an image file of my connection class.You can notice in that image that I have also added the MySQL connector jar file into the library
posted 1 year ago
In the future, please do not post screenshots of code and other text - post the text instead, so it can be quoted and copied/pasted.
I have also added the MySQL connector jar file into the library
But this is inside of NetBeans, where, as you said, the code runs fine. If you run the code outside of NetBeans -please tell us how you do that-, how are you adding the required libraries to the classpath?
Also, as there is logging in place, post the logging output of the code.
Well, one thing I told you is that according to JDBC 4.1 Version or from Java 7 onwards you won't require to perform the first step of the JDBC i.e, you won't need to Load and Register Driver.
that will be automatically done by the JDBC url through the jar file.
So line 42 of your program is redundant, even you write it or not, the output comes out to be same.
During the Preparation of Your Certification Examination NEVER EVER GIVE UP.