I haven't been able to figure this error out for a few days my program will compile but has the following error when I run it:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/b2xatestdb
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.gmail.greghess.main.Database.connect(Database.java:47)
at com.gmail.greghess.main.B2XAssistant.main(B2XAssistant.java:19)
I have checked over almost everything making sure I have the correct URL, login credentials, the server is up the credentials are valid. I have considered the possibly that it may be because I don't have the following line of code:
Class.forName("com.mysql.jdbc.Driver");
However I read somewhere that this line is no longer needed except in older versions of the library. I'm almost certain that the problem is that sublime text 3 is not using the the external jar file so I found the following direction on documentation that they provide here.
Dependencies
Javatar supports build and run project that have dependencies .jar files both global and specific projects. To add a dependency to global projects (all projects), go to Javatar Settings... > Dependencies... and select Add External .jar or Add Class Folder and Javatar will show a dialog to select a dependency you want to add. To add a dependency to current project, same as for global projects, but using Project Settings... > Dependencies... menu instead.
Upon executing these instructions I found out that sublime text 3 is not opening up a dialog for me to select a project dependency.
If anyone can help me figure out either the error in my code which is posted on github here or how to get st3 to allow me to set the dependent external jar it would be very much appreciated. Thank you for your time.
EDIT: I am using the following external jar for JDBC: mysql-connector-java-5.1.31-bin.jar
EDIT #2: I have cloned my repository on another computer and set up sublime text 3 the exact same way and have also run the program without problem. I have found that the problem is that for some reason on my other computer sublime text 3 is not popping up the GUI window for me to add the dependency.
The only thing I could get to work at all was following the instructions here and using a fresh install of Sublime Text 3, Package Control, and Javatar. If anyone has this problem and comes up with a better solution please post but it actually doesn't take all that much time for a fresh install. (Less than 3 minutes)