PDA

View Full Version : Simple solution wanted for a simple(?) problem




comike011
Jul 1, 2005, 11:21 PM
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!!!



mkrishnan
Jul 1, 2005, 11:33 PM
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.

comike011
Jul 1, 2005, 11:41 PM
Presently the database (.mdb file) is on the mac so there aren't any concerns with connecting to another machine. Its all internal.

mkrishnan
Jul 1, 2005, 11:56 PM
Presently the database (.mdb file) is on the mac so there aren't any concerns with connecting to another machine. Its all internal.

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?

comike011
Jul 2, 2005, 12:04 AM
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?

ChrisBrightwell
Jul 2, 2005, 12:53 AM
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.

comike011
Jul 2, 2005, 09:51 AM
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?

ChrisBrightwell
Jul 4, 2005, 03:09 PM
What do I need to do to export the file to SQL?
Either a working install of Access or a program that'll do the conversion for you. I'm not sure of any existing converters.