Exploring Your DB With Eclipse 101 - Part 2

Posted By : todd sharp Posted At : November 20, 2007 8:10 AM Posted In: Eclipse, Apache Derby

2

In my last post I showed you how to download, install, configure and connect the Eclipse Data Tools Platform to an Apache Derby Embedded database. Now I'll show you how to use the tool to create a table and do some basic queries. I'll also show how to set up your ColdFusion DSN to point to this new DB.

At this point if you're playing along at home you've set up your connection and are navigating through the schema in Eclipse. Your user tables will likely be stored in a catalog called 'App'. Right click on tables and choose 'New Table'.

Make some config choices.

You'll now get the table editor dialog.

Here you can name your table and add columns. Just click 'Add Column', highlight that column and rename it. Choose your datatype, set null options, defaults etc. Continue as needed for the rest of your columns.

Click Next and set primary key information.

DTP will now create your table creation SQL script.

To execute, right click and select Execute All (or use Ctrl-Alt-X). Your results will be displyed in the SQL results tab.

At this point you can use DTP to perform any standard SQL query. Select 'New Editor', enter any SQL statement and execute. Your results will be displayed in the SQL Results tab.

Now you'll want CF to hook up with this sweet new emdedded DB. DSN setup is dead simple - just like most other DSNs. Enter a DSN and select Apache Derby Embedded as the DSN type.

Point CF at the DB you created within Eclipse and enter the same credentials. Make any other settings as needed. Note: you do not have to check the 'Create Database' option at this point since it's already created. I don't believe it will hurt anything if you do, but note that the DB already exists.

That is it. CF can now query the Derby DB and you can easily manage it from right inside your favorite IDE.

Comments (2)

Pat Branley's Gravatar cool post. I used DTP for a while now with SQL server. The only thing that annoys me is that it brings up a stupid dialog box when running the SQL statement.

the RDS query viewer is a better tool for just standard SQL statements

kashi's Gravatar Can u pls help me witha source code how to insert a checkbox component into a list component in FLASH.