mySQL Database Connector For JDK 1.8?

I started this java tutorial on lynda.com and downloaded jdk 1.8.  When I got to the connecting mySQL through jsp, the code from the example files did not allow me to connect to the database.  Looking at this chart, I am guessing the problem is mysql-connector-java-5.1.35-bin.jar does not work with jdk 1.8.
Connector/J version        Java RTE required      JDK required (to build source code)
5.1                                         1.4.x, 1.5.x, 1.6.x      1.6.x and 1.5.x (or older)
Any of the experts know if there is a connector that works with jdk 1.8 or will i have to install a jdk 1.6 to get things working? The below code just returns the "error connect to database".
<%@ page import="java.sql.*" %><%@ page import="java.io.*" %><%@ page import = "com.mysql.*" %><?xml version="1.0"?>
<tours>
<%      
     Connection connection = null;
     Statement statement = null;
     ResultSet result = null;
     try {
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/tours", "root", "root");
         out.println("connected to database");
      }
      catch(SQLException e) {
           out.println("error connecting to database");
      }
%>
</tours >

Open in new window

xoxomosAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
I don't know where you found that table of compatibility but I would be VERY surprised if there was a problem with that version of the connector on Java 8. I would say that the problem would be elsewhere. What you need to do is to see what the actual error is. Add the following line inside the "catch" block (between lines 13 & 14 of the code above...

e.printStackTrace();

Open in new window


And then try connecting again, and when you get the error, examine your logs for the full exception stack trace. If it is then NOT obvious as to what is happening, please post the complete stack trace that you get and we can have a look at it.
xoxomosAuthor Commented:
Thanks.   I'll try finding the logs tomorrow .  I know there is Apache Tomcat and wampserver.  Assuming logs i'm looking for are Apache.
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Yes, there should be a "logs" directory under the main apache tomcat installation directory. Have a look through all the files in there, but it should be in either "catalina.log", "tomcat-stderr.log" or "tomcat-stdout.log"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

xoxomosAuthor Commented:
Thanks again.  I'll probably have another question tomorrow.
mccarlIT Business Systems Analyst / Software DeveloperCommented:
You're welcome!
xoxomosAuthor Commented:
The lynda.com tutorial has us download wamp for a test server and use 'root' user and 'root' pw.  I suspect the wamp for download now is a bit different from when the tutorial was written since the solution was to go into one of wamp's
config files and change the pw from 'NO' to match whatever you put on the connect string.
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Good to know, thanks for the update!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.