aspose file tools*
The moose likes JDBC and the fly likes java db on a mac-getting started Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java db on a mac-getting started" Watch "java db on a mac-getting started" New topic
Author

java db on a mac-getting started

Bert Wilkinson
Ranch Hand

Joined: Oct 28, 2009
Posts: 33
Hello Ranchers.

I'm an intermediate Java programmer in spare time and have been chipping away at an application that I'd like to augment with a database...and that's where the trouble starts.

I'm using a MAC w/ Snow Leopard and Eclipse IDE with Java 1.6 JRE in the MAC. I'm having trouble getting going in the right direction here, so any help would be appreciated. Done a couple Google searches, etc. and haven't come up with a good "hello world" ish layout of how to get this going. So, in no particular order:

1. I understand that JDBC components are incorporated in the 1.6 JDK. However, Apple seems to be on it's own program and if there in there...I can only find the sql drivers jar file within Eclipse. Am I missing a bunch here within the Apple release?

2. In light of issues with (1) above, I downloaded the latest Derby build and started toying with it. I'm interested in running the DB embedded in my application (it's small scale...just looking for easy access to data). Are there any good tutorials on setting up build paths, etc. to get an embedded application up and cooking on mac?

3. The Derby documentation is pretty sparse on setting up on MAC OS X. Any steer on how to do that if I want to run it independently? I've done the PATH variable game on Windows before, so I have some familiarity on that side--but never on MAC.

4. Lastly, assuming I can get Derby up and running independently, is there a easy data access program that I can interface with the DB to create tables and enter data in tabular fashion to build them up?

Obviously I'm a databasing rookie....just looking for some guidance / website / book on this.

Thanks!

Jeff
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42289
    
  64
Welcome to JavaRanch.

1. I understand that JDBC components are incorporated in the 1.6 JDK. However, Apple seems to be on it's own program and if there in there...I can only find the sql drivers jar file within Eclipse. Am I missing a bunch here within the Apple release?

I'm not sure what you mean by "on its own program". The JDK includes the JDBC API, and that's all you need to get started from the core Java point of view. Apart from that you'll need the JDBC driver for whichever DB you intend to use; they can generally be found in the same place as the DB itself (and in the case of Derby are included in the download).

2. In light of issues with (1) above, I downloaded the latest Derby build and started toying with it. I'm interested in running the DB embedded in my application (it's small scale...just looking for easy access to data). Are there any good tutorials on setting up build paths, etc. to get an embedded application up and cooking on mac?

The first hit for googling "embedded derby" was http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html which seems highly relevant; apparently Derby comes with an example application that uses it in embedded mode.

3. The Derby documentation is pretty sparse on setting up on MAC OS X. Any steer on how to do that if I want to run it independently? I've done the PATH variable game on Windows before, so I have some familiarity on that side--but never on MAC.

If you run Derby in embedded mode, then there's no extra DB process to start, and consequently no executable for which a PATH might be relevant. I'd start by looking at said example app, and try to figure out what it does and how it does it.

4. Lastly, assuming I can get Derby up and running independently, is there a easy data access program that I can interface with the DB to create tables and enter data in tabular fashion to build them up?

http://squirrel-sql.sourceforge.net/ is a pretty good JDBC GUI client. Be careful about not running it in parallel with your main application, though - embedded DBs assume that no other JVM is accessing the underlying DB files at the same time, and doing so WILL cause corruption.


Ping & DNS - my free Android networking tools app
Bert Wilkinson
Ranch Hand

Joined: Oct 28, 2009
Posts: 33
Thanks for the steer. I think I can get there from here....

What I meant by "on own program" is that MAC seems to handle most of the Java download automatically w/ it's software update. I've got JRE 6.x in there but I can't find the derby stuff before downloading it and manually adding it in to the build path. Works now, though.

I saw the Derby link you posted....didn't have too many MAC specifics, although I know most of the Unix stuff translates.

I got the embedded db sample to work...now will try to get derby running independently so I can build some tables with the squirrel link you passed.

Thanks for the leg-up.

-Jeff
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Jeff TheDude wrote:

Please check your private messages for an important administrative matter


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java db on a mac-getting started