Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Java / MySql

Java / MySql
Thread Tools
TonyK
Guest
Status:
Reply With Quote
Oct 29, 2000, 10:34 PM
 
Feels good to have a real database running on my mac - thanks very much for the port.

I am now trying to move a Java app that previously worked from FileMaker to MySQL but cannot even get the driver (caucho) to register - ClassNotFound.

I'm working in ProjectBuilder and am still unfamiliar in its ways but have tried everything I can think of (other than trying other Drivers) to get the .jar to register.

I'm sure there's an obvious solution, although after two days I still can't see it.
     
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Apr 7, 2001, 02:53 PM
 
In general, to add jar files to the classpath in Project Builder you call "Add Framework" from the "Project" menu. The problem with JDBC is that the code will compile even if the class is not in the classpath. Try changing your code to this:

void main(...)
{
// do this to allow the compiler to verify that the drivers are in the
// classpath
Class c = jdbc.Driver.class;
// normal JDBC driver register method - loads class by name so
// compiler can't verify it.
Class.forName("jdbc.Driver");
}

Once your code runs and compiles successfully, you can remove the first class lookup since it's only purpose was to check the classpath.

BTW, if you get an error other than ClassNotFoundException or NoClassDefFoundError, then the classpath is correct. Some drivers are compiled as package private, so the first call will throw an IllegalAccessException. If you get that, your classpath is good.

[This message has been edited by absmiths (edited 04-07-2001).]
     
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Apr 7, 2001, 09:06 PM
 
I had a relatively easy time with following MySQL JDBC driver:
http://www.worldserver.com/mm.mysql/

It also has excellent introductory documentation.
iMac 17" G4 800MHZ & 768 SDRAM
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:37 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2