New mac programmer (Java,jdbc-odbc)

Discussion in 'Mac Programming' started by comike011, Jun 30, 2005.

  1. comike011 macrumors newbie

    Jun 30, 2005
    New York, New York
    SO Im new to both mac programming and database access via java programs. Im trying to write a program that uses a .mdb database using xcode but am not able to load the driver apparently. The following:


    is leading to a ClassNotFoundException that stops the program. This is probably a pretty lame question, but I cant figure it out (can you get banned for insulting yourself?). Any help with how to this would be great, Thanks.
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    That class is not in your classpath. To find out what your classpath is open the Terminal and type echo $CLASSPATH. It may well not return anything in which case you are using the system classpath. If this is the case find out where that class is on your system and and that folder root your your classpath (i.e. you want to add folder that contains sun, not the folder with the actual class file).
  3. dlamet macrumors newbie

    Nov 11, 2009
    JDBC-ODBC Bridge Not Default on Mac OS

    The reason you're not finding the sun.jdbc.odbc.JdbcOdbcDriver is that it's not provided in the version of Java shipped on the Mac. The JDBC-ODBC Bridge using that class was written a long time ago when ODBC was not available on the Mac. It used native Windows components, and so was not portable.

    ODBC is now provided on OS X via the iODBC open source project. They do a reasonably good job of implementing ODBC for non-Windows systems. But they don't take ownership of the JDBC-ODBC Bridge, and neither does Apple who produces Java for OS X. Hopefully some eager souls out there are working on this void. OpenLink provides a solution, but it's very expensive. (Just priced out a minimal installation at $569.25.)

    If you're trying to get to MS Access via JDBC, there are a couple of direct alternatives. HXTT sells a driver <> and so does Stels <>. I've just done minimal evaluation on both, and they both seem to work well. Bypassing ODBC will be more efficient for you anyway. One less layer.


Share This Page