Exploring Your DB With Eclipse 101 - Part 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
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
# Posted By Pat Branley | 11/20/07 6:04 PM
Can u pls help me witha source code how to insert a checkbox component into a list component in FLASH.
# Posted By kashi | 11/21/07 8:44 AM

Calendar

Sun Mon Tue Wed Thu Fri Sat
   1234
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex funny stuff javascript misc model-glue off topic personal project learn slidesix sql

Recent Comments

Adding Auto Generated Code Downloads to BlogCFC
ada5fsa said: http://www.ibiblio.org/st... http://www.ncaonline.org/...... [More]

Chinese Birth Calendar Accuracy Test
mama to be said: ok so i will be 2 months shy of 18 when i have my baby. this calendar does not technically work for ... [More]

Fixing 'User Profile Service Failed The Logon' on Vista
Mike said: That fix worked although all i did was remove .bak and reset state to 0. User was able to log in to... [More]

Chinese Birth Calendar Accuracy Test
Melissa said: Wrong for my daughter, which it predicted to be a boy... we'll see for #2. Predicts a girl (maybe, f... [More]

Adding Auto Generated Code Downloads to BlogCFC
fweerw said: http://www.ibiblio.org/st... http://www.cambodia.ait.a...... [More]

RSS


adobe community experts

coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com