• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

MySQLDriver Library Load Issue

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since my class is done, and thanks to this site I got a 97% for the class, I decided to install the newest Apache Netbeans and start using it but trying to load in my project for that class, I have some things I want to do with it to improve it and help me learn more, it pops up an issue with MySQLDriver. I added the library but still it won't recognize it.

This is the full error if I try building and running the project:

Warning: Could not find resource file "C:\Path\to\Library\CapestraApp\${libs.MySQLDriver.classpath}" to copy.



Any ideas or suggestions to fix this issue. Oh, this is what I'm loading in my CapestraDB.java file:


So I'm not sure what is going on since I added the library.
 
Steven Moore
Ranch Hand
Posts: 41
  • Likes 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
LOL, nevermind, I fixed it by going to the Properties for the libraries and removing the requirement for the old MySQL connector.
 
Ranch Hand
Posts: 127
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, nice that you not just replied with "I fixed it" but also telling us how.
Btw: Since JDBC4 (which every modern jdbc driver complies to) the Class.forName isn't needed as DriverManager uses ServiceLoader to find all jdbc drivers in the classpath. So you can just remove this line. Also, as com.mysql.jdbc.Driver is the legacy one the driver should inform you with a log message to not to use it anyway.
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic