Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Loading drivers

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've done all I could to try and correct this error, but I'm out of ideas at the moment.
Anyhow, yesterday I created a simple application that inserted some test data into a MySQL database. It was in Netbeans's \sampledir\ directory. Today I have a project that is in a different directory ( I mounted it in Netbeans and it is also my CLASSPATH ). I tried to load the MySQL driver by using the following:

I get an error saying the class was not found, even though I have it in \lib\ext\.
This probably has a ridiculously easy solution, but it's just not coming to me.
Any help is appreciated, once again.
// :: Peyton
[ February 08, 2004: Message edited by: Peyton McCullough ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to JDBC.
 
Peyton McCullough
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, my CLASSPATH is C:\MARKET and I have the mySQL driver in C:\MARKET\org\gjt\mm\mysql as well, yet it gives me 'NoDefClassError' now.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've used Forte for Java but not Netbeans, so I'm not sure about the specifics for setting up the Classpath.
What you will find is that IDEs ignore the system classpath and allow each application being developed within the IDE to have its own classpath that is defined within the IDE itself. You're right that the lib/ext should have done the trick, maybe you're putting it in the wrong one. Can you be sure of which version Netbeans is running? I'm just thinking it may be shipped with its own JDK so you'll need to drop the JAR there instead.
I'd have a look at the netbeans documentation for instructions setting the Classpath for applications. You may need to look at the properties for that application like you need to do in other IDEs.
Not quite an answer, but get back to us if you get any further.
Dave.
 
Peyton McCullough
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using the NetBeans version that comes in a bumdle with the 1.4.2 SDK. Sometimes it will compile in NetBeans, but when I try to run it via 'cmd' ( 'java server1' ) I get the error.
Thanks for your interest in the subject, I'll look forward to your next reply.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The netbeans FAQ has the question How do I add a JAR file in my CLASSPATH in Forte? that sounds similar. Is this what you are looking for?
 
Peyton McCullough
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aha!
I figured out the problem. I was using the 'java.exe' I obtained from http://java.com rather than the 'java.exe' located within the SDK. Apparently it makes a difference.
Many thanks for your post though!
Also, thanks for the NetBeans link. That may also prove useful. I'll bookmark it.
[ February 08, 2004: Message edited by: Peyton McCullough ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic