• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java db on a mac-getting started

 
Bert Wilkinson
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bert Wilkinson
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff TheDude wrote:

Please check your private messages for an important administrative matter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic