Foiled by MySQL Connector/J Again

All right. I dumped a lot of emails from Amazon to a text file. I parsed that file and have a lot of thousands of Amazon Kindle books that I own. Now I want to add them to a database. I want to stick them in MySQL specifically. So I call on JDBC to do the deed.

I run into the dread error "java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/". Now I have received that error before. I thought the solution was to stick the JAR file with the MySQL JDBC driver in the class path. Nope. That did not do the trick.

For a while I was pulling my hair out, trying to figure this out. Then I went back to an old project where I got this working. Turns out you need to explicitly path the JAR file in the classpath. I had thought you only needed to specify its directory. No. You need the fully qualified path including the JAR filename in the classpath. Go figure.

At least I got a boatload of book titles inserted into a MySQL database table. Now for the really fun part. Time to write a program to find the books on Amazon's web site and scrape some details out.