Simple solution wanted for a simple(?) problem

Discussion in 'Mac Programming' started by comike011, Jul 1, 2005.

  1. comike011 macrumors newbie

    Joined:
    Jun 30, 2005
    Location:
    New York, New York
    #1
    I am completely new to both mac and java programming. So to help with the learning process I took on a project that requires me to connect to a Microsoft access database and make updates via a java program. Ive tried to do this in both xcode and eclipse but both resulted in a little less than no progress. What can I do to connect to this database? What do I need for it? Is this even possible? PLEASE HELP!!!
     
  2. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #2
    Are you trying to access the MS Access DB while it sits on the Mac, or while it is being hosted for ODBC by a Windows computer? How far have you gotten in getting the Mac to talk via Java to the Win computer, assuming the latter?

    I've done this in Java on Windows, but it's been a while.
     
  3. comike011 thread starter macrumors newbie

    Joined:
    Jun 30, 2005
    Location:
    New York, New York
    #3
    Presently the database (.mdb file) is on the mac so there aren't any concerns with connecting to another machine. Its all internal.
     
  4. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #4
    I'm not sure what you're describing is possible. The way I understand the kind of thing you're trying to do, you write in JDBC calls within Java, and then the JRE uses the JDBC-ODBC bridge to talk to ODBC, and ODBC talks to MS Access to change the database file. I don't think that you can modify an Access database that's sitting on a Mac using ODBC, because there's no application that actually has the capability to open the database file.

    But, if you intend to use a drastically different method to access the database, can you please explain farther?
     
  5. comike011 thread starter macrumors newbie

    Joined:
    Jun 30, 2005
    Location:
    New York, New York
    #5
    This is a problem that I was worried about, but what the person Ive been talking with about this and me are thinking is that the database file can be used as a sort of "black box". The only way to edit this file would be via the java program that can access it. Is a program needed that can use the file independently of the java program?
     
  6. ChrisBrightwell macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #6
    You need something to serve up the database file. Either you have to custom-write a parser (good luck) that can load it and build it in memory in some useful, tangible form or you find a server.

    MS has ODBC, which works decently well for small projects. It's not avaialble for OS X, though.

    You can export the DB to SQL and used JDBC calls to the SQL server in OS X.

    There's no way to directly access an Access database file, though. Not the way you want to.
     
  7. comike011 thread starter macrumors newbie

    Joined:
    Jun 30, 2005
    Location:
    New York, New York
    #7
    What do I need to do to export the file to SQL? Can I do all of this from my computer or would I need a pc for further support?
     
  8. ChrisBrightwell macrumors 68020

    ChrisBrightwell

    Joined:
    Apr 5, 2004
    Location:
    Huntsville, AL
    #8
    Either a working install of Access or a program that'll do the conversion for you. I'm not sure of any existing converters.
     

Share This Page