2 Replies Latest reply: Jan 20, 2007 4:35 PM by 807599 RSS

    MySQL driver error

    807599
      I have this problem connecting to MySQL database. I'm, using Netbeans 5.5 and I have installed connector/j driver. In Netbeans under Databases-Drivers-MySQL (connector/j driver) driver class is :
      com.mysql.jdbc.Driver.
      But when i try this :
      Class.forName("com.mysql.jdbc.Driver");
      My servlet breaks.

      How can I solve this. TNX!
        • 1. Re: MySQL driver error
          796254
          I have this problem connecting to MySQL database.
          I'm, using Netbeans 5.5 and I have installed
          connector/j driver. In Netbeans under
          Databases-Drivers-MySQL (connector/j driver) driver
          class is :
          com.mysql.jdbc.Driver.
          I don't know NetBeans, so I don't know what "installed" means.

          >
          But when i try this :
          Class.forName("com.mysql.jdbc.Driver");
          My servlet breaks.
          What does "breaks" look like? Do you get an exception? What is the precise message? That would help.
          How can I solve this. TNX!
          Probably a ClassNotFoundException, which tells me that "installs" is not the same as putting the MySQL driver JAR in your CLASSPATH. Put it in the Tomcat common/lib directory if it's not there already and restart Tomcat

          %
          • 2. Re: MySQL driver error
            807599
            You ware right ! I just needed to copy driver in Netbean's bounded Tomcat server directory. Now it works.

            TNX!