com.mysql.jdbc does not exist

Discussion in 'Java' started by bruce, Nov 1, 2010.

  1. bruce

    bruce Guest

    I am getting the error "com.mysql.jdbc does not exist" when I compile
    with NetBeans.

    I have mysql-connector-java-5.1.13-bin.jar set as
    c:\Program Files\Java\jre6\lib\ext\mysql-connector-java-5.1.13-bin.jar

    In NetBeans, I went to Tools->Libraries. Under Libraries, I have
    "MYSQL JDBC Driver" Clicking on this, displays. the above setting.

    I also notice that NetBeans has:
    c:\Program Files\NetBeans 6.9.1\ide\modules\ext\mysql-connector-
    java-5.1.6-bin.jar"
    in this same Library.

    Is this a problem????

    My System is:
    Product Version: NetBeans IDE 6.9.1 (Build 201007282301)
    Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
    System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

    What do I need to do get NetBeans to find com.mysql.jdbc?

    Thanks...

    Bruce
    bruce, Nov 1, 2010
    #1
    1. Advertising

  2. In article
    <>,
    bruce <> wrote:

    > I am getting the error "com.mysql.jdbc does not exist" when I compile
    > with NetBeans.
    >
    > I have mysql-connector-java-5.1.13-bin.jar set as
    > c:\Program Files\Java\jre6\lib\ext\mysql-connector-java-5.1.13-bin.jar
    >
    > In NetBeans, I went to Tools->Libraries. Under Libraries, I have
    > "MYSQL JDBC Driver" Clicking on this, displays. the above setting.
    >
    > I also notice that NetBeans has:
    > c:\Program Files\NetBeans 6.9.1\ide\modules\ext\mysql-connector-
    > java-5.1.6-bin.jar"
    > in this same Library.
    >
    > Is this a problem????
    >
    > My System is:
    > Product Version: NetBeans IDE 6.9.1 (Build 201007282301)
    > Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
    > System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
    >
    > What do I need to do get NetBeans to find com.mysql.jdbc?


    It sounds like your library is set up correctly: you're allowed to have
    different versions in different entries. Now, just add the desired
    library to the project that needs it.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
    John B. Matthews, Nov 1, 2010
    #2
    1. Advertising

  3. bruce

    bruce Guest

    On Nov 1, 5:15 pm, "John B. Matthews" <> wrote:
    > In article
    > <>,
    >
    >
    >
    >  bruce <> wrote:
    > > I am getting the error "com.mysql.jdbc does not exist" when I compile
    > > with NetBeans.

    >
    > > I have mysql-connector-java-5.1.13-bin.jar set as
    > > c:\Program Files\Java\jre6\lib\ext\mysql-connector-java-5.1.13-bin.jar

    >
    > > In NetBeans, I  went to Tools->Libraries. Under Libraries, I have
    > > "MYSQL JDBC Driver"  Clicking on this, displays. the above setting.

    >
    > > I also notice that NetBeans has:
    > >   c:\Program Files\NetBeans 6.9.1\ide\modules\ext\mysql-connector-
    > >   java-5.1.6-bin.jar"
    > > in this same Library.

    >
    > > Is this a problem????

    >
    > > My System is:
    > > Product Version: NetBeans IDE 6.9.1 (Build 201007282301)
    > > Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
    > > System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

    >
    > > What do I need to do get NetBeans to find com.mysql.jdbc?

    >
    > It sounds like your library is set up correctly: you're allowed to have
    > different versions in different entries. Now, just add the desired
    > library to the project that needs it.
    >
    > --
    > John B. Matthews
    > trashgod at gmail dot com
    > <http://sites.google.com/site/drjohnbmatthews>


    Thanks.. You were absolutely correct. As soon as I told my application
    about the library, the error went away..

    Thanks again....

    Bruce
    bruce, Nov 1, 2010
    #3
  4. bruce

    markspace Guest

    On 7/4/2012 3:03 PM, chalasa wrote:
    > how to you tell the particular project about the library
    >
    >


    Use the CLASSPATH.


    <http://docs.oracle.com/javase/tutorial/essential/environment/paths.html>

    <http://docs.oracle.com/javase/tutorial/java/package/managingfiles.html>
    markspace, Jul 4, 2012
    #4
  5. bruce

    Lew Guest

    markspace wrote:
    > chalasa wrote:
    >> how to you tell the particular project about the library

    >
    > Use the CLASSPATH.


    Actually, don't. Use the classpath instead. CLASSPATH is an antipattern for
    most use cases.

    > <http://docs.oracle.com/javase/tutorial/essential/environment/paths.html>
    >
    > <http://docs.oracle.com/javase/tutorial/java/package/managingfiles.html>


    The problem with the CLASSPATH environment variable (envar) is that it affects
    *every* Java program on the system. To tell the *particular* project about the
    library, as the OP requested, you have to tell the *particular* project's
    classpath where to find the library.

    RTFM. The Oracle site goes into details about the "tools" (java, javac,
    javaws, etc.) and their options.

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
    Lew, Jul 5, 2012
    #5
  6. bruce

    Roedy Green Guest

    On Wed, 04 Jul 2012 17:03:02 -0500, chalasa <>
    wrote, quoted or indirectly quoted someone who said :

    >how to you tell the particular project about the library


    see http://mindprod.com/jgloss/jdbc.html
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    Why do so many operating systems refuse to define a standard
    temporary file marking mechanism? It could be a reserved lead character
    such as the ~ or a reserved extension such as .tmp.
    It could be a file attribute bit. Because they refuse, there is no
    fool-proof way to scan a disk for orphaned temporary files and delete them.
    Further, you can't tell where the orhaned files ame from.
    This means the hard disks gradually fill up with garbage.
    Roedy Green, Jul 5, 2012
    #6
  7. bruce

    Jeff Higgins Guest

    On 07/04/2012 06:03 PM, chalasa wrote:
    > how to you tell the particular project about the library

    <http://netbeans.org/kb/docs/java/project-setup.html#projects-classpath>
    Jeff Higgins, Jul 5, 2012
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Johnson
    Replies:
    0
    Views:
    1,228
    Bill Johnson
    Jul 8, 2005
  2. Keith Wansbrough

    Re: jdbc help:sun.jdbc.odbc.JdbcOdbcDriver

    Keith Wansbrough, Aug 16, 2004, in forum: Java
    Replies:
    0
    Views:
    736
    Keith Wansbrough
    Aug 16, 2004
  3. Betty
    Replies:
    1
    Views:
    9,851
    Juha Laiho
    May 21, 2005
  4. LT
    Replies:
    7
    Views:
    2,080
    Phlip
    Jul 25, 2004
  5. Bill Johnson

    CS0234 Global does not exist ... but it genuinely does

    Bill Johnson, Jul 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    189
    Bill Johnson
    Jul 8, 2005
Loading...

Share This Page