SlideShare a Scribd company logo
1 of 107
Scout/Tutorial/3.8/Database
Development Perspective
< Scout | Tutorial | 3.8
Scout
Wiki Home
Website
Download • Git
Community
Forums • Blog • Twitter • G+
Bugzilla
Bugzilla
Contents
[hide]
 1 Configure the Database Development View
o 1.1 Install Database Development
o 1.2 Add new Derby Connection
o 1.3 Specify Driver Details
o 1.4 Access the Derby database on the Command Line
Configure the Database Development
View
This page shows how to install, configure and use the database development view in eclipse.
Alternatively, using and browsing Derby databases on the command line is shown at the end
Install Database Development
If you have not yet installed the database development package use menu Help and then Install
New Software....
On Install dialog fill the Work with drop-down list with --All Available Sites-- and tick the
checkbox Database Development
Step through the install dialog and restart your Eclipse
Add new Derby Connection
Open the Database Development perspective, right click on Database Connections and call the
wizard for adding a new database connection by clicking on the context menu New....
From the list of available connection profiles, choose Derby.
Specify Driver Details
Open the driver deteail editor by clicking on the round icon to the right of the Drivers combobox.
Choose the embedded derby driver for version 10.2.
Go to the tab Jar List and there specify the location of the derby.jar. If you don't have any, download
it (from the official derby website: http://db.apache.org/derby/, it's inside the zip file) or download
the TutorialMiniCrmWorkspaceDerbyDB and click on ok to leave this page.
Add the path to your DerbyDb along with the login data (for the minicrm: minicrm/minicrm).
When you have entered all the required data, click on Test connection in order to test the connection
details you just entered. If everything is fine there will be a message box Ping succeeded.
Now you can browse through the DerbyDB, modify tables, data, run statements and much more.
Please be aware that you cannot have more than one connection to your DerbyDb, therefore
either you browse through it in the database development view or you access it using the minicrm,
therefore you need to manually disconnect from the database before you can run your application.
Access the Derby database on the Command Line
Change to the library folder of your Derby installation, then type the following in the DOS shell to
connect to your database.
C:DerbyDBdb-derby-10.6.2.1-binlib>java -classpath derby.jar;derbytools.jar org.ap
ache.derby.tools.ij
ij version 10.6
ij> connect 'jdbc:derby:c:/derbydb';
Remark: For the above example the derby installation is found under C:DerbyDBdb-derby-10.6.2.1-
bin and the data base is stored directly under C:DerbyDB
Troubleshooting
If you get an error message similar to
ERROR XJ040: Failed to start database 'c:/derbydb' with class loader
sun.misc.Launcher$AppClassLoader...
ERROR XSDB6: Another instance of Derby may have already booted the database C:DerbyDB
you might still have your Scout server running that is accessing the database. If so, stop the server
in the Scout perspective and try again.
Once connected you may browse, change, ...
ij> show schemas;
TABLE_SCHEM
------------------------------
APP
MINICRM
...
ij> show tables in minicrm;
TABLE_SCHEM |TABLE_NAME |REMARKS
------------------------------------------------------------------------
MINICRM |COMPANY |
MINICRM |COMPANY_FIGURES |
MINICRM |CRM_SEQ |
...
ij> describe minicrm.company;
COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
COMPANY_NR |DECIMAL |0 |10 |5 |NULL |NULL |NO
SHORT_NAME |VARCHAR |NULL|NULL|60 |NULL |120 |NO
...
Finally
ij> disconnect;
ij> exit;
Category:
 Scout Tutorial 3.8
Getting Started With the Oracle Database Plugin for Eclipse
1. Introduction
2. Using the Tool
1. Database Explorer
1. Connecting to an Oracle Database
2. Exploring an Oracle Database
3. Editing Data from a Table
4. Loading Data into a Table
5. Extracting Data from a Table
6. Generating DDL
2. SQL Tools
1. Using SQL Editor
2. Executing a Stored Procedure or Function
3. Executing Explain Plan
3. Additional Features
1. Granting Privileges
3. Known Issues
4. Further Resources
1. Introduction
Welcome to the firststep towards supporting the Eclipse Data Tool Platform (DTP) by Oracle. This document
provides a high-level tour through each of the Oracle Database Plugin features.
Note that screen shots and examples in this document use the HR schema that is installed by
default with Oracle Database. You may download Oracle Database 10g Express Edition - Free
Download.
2. Using the Tool
2.1. Database Explorer
The Database Explorer is the Datasource View provided by the DTP. It is used to create Database connections and
to navigate the database.
2.1.1. Connecting to an Oracle Database
You can create a connection to a database using the Data Source Explorer view.
To open the Database Developmentperspective,click Windows > Open Perspective > Other from the Main menu,
and then select Database Development from the Open Perspective dialog.This perspective opens the Data
Source Explorer (DSE) view.
Figure 1. Opening Database Perspective
Rightclick on the Databases node in DSE and select New... to create a database connection,as Figure 2 shows.
Figure 2. New Database Connection
This displays the New Connection Profile wizard, as Figure 3 shows.
Figure 3. New Connection Profile Dialog
Select Oracle Database Connection from the list,and then click Next.
If "Oracle Database Connection"is notlisted, restartEclipse with -clean command option.Provide a name for the
connection and proceed to the next step.
Complete the restof the dialog as follows:
 Select Oracle Database 10g Driver Default from the drop-down listofdrivers.
 Click Edit Driver Definition triangular button on the right, selectthe Jar List tab, then selectthe existing
entry, and click Edit JAR/Zip. Browse to your eclipse directory, open the plugins folder, and select
the oracle.eclipse.tools.database.jdbc.driver*.jar file.
Note that you need to do this only once.
 If the defaults are not appropriate for your configuration,change the following information in the URL field:
o replace localhost with the hostname or IP address ofthe Oracle Database server.
o replace 1521 with the port number of the Oracle Database Listener service.
o replace xe with the Service Name (or SID) of the Database Service.
 Provide the database user name and password for the connection.
 Use the following optional properties ifrequired:
1. autocommit=false
By default, autocommitis setto true, which results in immediate commitofthe operations from
SQL Editor. When setto false, you need to execute the explicit COMMIT to committhe changes.
See Oracle Database SQL Reference for more information.
2. sysdba=true
Use this property to login with SYSDBA account.
3. sysoper=true
Use this property to login with SYSOPER account.
 Click Test Connection to test the connectivity.
 Select Connect when the wizard completes checkbox to enable the database connection.
 Select Finish to complete the wizard.
Figure 4. Database Connection Details
2.1.2. Exploring the Oracle Database
The open database connection allows you to navigate through the database objects.
Figure 5. Exploring the Database
Getting Started With the Oracle Database Plugin for Eclipse
1. Introduction
2. Using the Tool
1. Database Explorer
1. Connecting to an Oracle Database
2. Exploring an Oracle Database
3. Editing Data from a Table
4. Loading Data into a Table
5. Extracting Data from a Table
6. Generating DDL
2. SQL Tools
1. Using SQL Editor
2. Executing a Stored Procedure or Function
3. Executing Explain Plan
3. Additional Features
1. Granting Privileges
2. Creating Tables
3. Known Issues
4. Related Information
1. Introduction
Welcome to the firststep towards supporting the Eclipse Data Tool Platform (DTP) by Oracle. This document
provides a high-level tour through each of the Oracle Database Plugin features.
Note that screen shots and examples in this document use the HR schema that is installed by
default with Oracle Database. You may use Oracle Database 11g Release 1, or download
Oracle Database 10g Express Edition - Free Download.
2. Using the Tool
2.1. Database Explorer
The Database Explorer is the Datasource View provided by the DTP. You use it to create Database connections and
to navigate the database.
2.1.1. Connecting to an Oracle Database
You can create a connection to a database using the Data Source Explorer view, as follows:
1. To open the Database Developmentperspective,click Windows > Open Perspective > Other from the
Main menu,and then select Database Development from the Open Perspective dialog.This perspective
opens the Data Source Explorer (DSE) view.
Figure 1. Opening Database Perspective
2. Rightclick on the Databases node in DSE and select New... to create a database connection,as Figure
2 shows.
Figure 2. New Database Connection
This displays the New Connection Profile wizard, as Figure 3 shows.
Figure 3. New Connection Profile Dialog
3. Select Oracle Database Connection from the listand provide a name for the connection.Click Next to
proceed to the next step.
4. Complete the restof the dialog as follows:
o Select either Oracle Database 10g Driver Default or Oracle Database 11g Driver Default from
the drop-down listofdrivers, as Figure 4 shows.
o If the defaultsettings are not appropriate for your configuration,change the following information on
the Properties > General tab of the New Connection Profile dialog:
 In the SID field,replace xe with the Service Name (or SID) of the Database Service.
 In the Host field, replace server with the hostname or IP address ofthe Oracle Database
server (possiblylocalhost).
 In the Port number field, replace 1521 with the port number of the Oracle Database
Listener service.
 Provide the database user name and password for the connection.
Note that the Connection URL field reflects your changes.
 Select a use group in the Catalog field.
o On the Properties > Optional tab, setthe following optional properties,ifrequired:
 autocommit=false
By default, autocommitis setto true, which results in immediate commitofthe
operations from SQL Editor. When setto false, you need to execute the
explicit COMMIT to committhe changes.See Oracle Database SQL Reference for more
information.
 sysdba=true
Use this property to login with SYSDBA account.
 sysoper=true
Use this property to login with SYSOPER account.
o Click Test Connection to test the connectivity. If this fails,try restarting Eclipse with -
clean command option.
o Select Connect when the wizard completes checkbox to enable the database connection.
o Select Finish to complete the wizard.
Figure 4. Database Connection Details
2.1.2. Exploring the Oracle Database
The open database connection allows you to navigate through the database objects.
Figure 5. Exploring the Database
2.1.3. Editing Data from a Table
With the enabled database connection,you can edit the table data in the Data Source Explorer (DSE).
Note that, for comprehensive editing capabilities,itis recommended thatyou install Data Tools Platform SQL
DevelopmentTools Data Functions feature,as follows:
 If your machine is located inside ofa network,which requires a proxy to access outside resource such as
the Internet, the configuration (download) mayfail due to the fact that Eclipse IDE includes a Web browser
to let you access the Internet from within the IDE. In this case,reconfigure your Eclipse IDE proxy settings
using Window > Preferences > General > Network Connections.
 Select Help > Software Updates from the main menu.
 Open the Available Software tab on the Software Updates and Add-ons dialog.
 Click Add Site to install the feature provided by OEPE from OEPE's update site.To do so,
enter http://www.oracle.com/technology/software/products/oepe/oepe_12g.htm
l in the Location field of the Add Site dialog,and then click OK.
 Expand the Ganymede Update Site node, and then expand the Database Development node.Select Data
Tools Platform SQL Development Tools Data Functions, and then click Install.
To edit a table data, navigate to the table you wantto editin the DSE, then right-click the table, and select Data >
Edit, as Figure 6 shows.
Figure 6. Editing Database Table
This opens the table data in the editor, as Figure 7 shows.You can make changes to the table data by right-clicking
on a table cell and using the popup menu.When you have finished editing,click Save to save the changes to the
database.
Figure 7. Database Table Editor
2.1.4. Loading Data into a Table
To load data into a table from a text file, in the DSE, navigate to the table into which you want to load data. Right-click
the table, and select Data > Load from the drop-down menu,as Figure 8 show.
Figure 8. Loading Data
This opens the Load Data dialog,as Figure 9 shows.Complete fields on the dialog,and then click Finish.
Figure 9. Load Data Dialog
Note that this may fail if there is a foreign key violation.
2.1.5. Extracting Data from a Table
To extract data from a table to a text file, in the DSE, navigate to the table from which you want to extract data. Right-
click the table and select Data > Extract from the drop-down menu,as Figure 10 shows.
Figure 10. Extracting Data
This opens the Extract Data dialog,as Figure 11 shows.Complete fields on the dialog,and then click Finish.
Figure 11. Extract Data Dialog
2.1.6. Generating DDL
You can use the Generate DDL option on mostdatabase objects to create or drop the object.
In the DSE, navigate to the objectyou want to create or drop,right-click the object, and select Generate DDL from
the drop-down menu to create a DDL script,as Figure 12 and Figure 13 show.
Note that you need to create a projectin order to save the generated DDL script.See Creating a project for more
details.
Figure 12. Generate DDL
Figure 13. Generating DDL
The preceding steps generate the following statements:
CREATE VIEW EMP_DETAILS_VIEW
(EMPLOYEE_ID, JOB_ID, MANAGER_ID,
DEPARTMENT_ID, LOCATION_ID, COUNTRY_ID, FIRST_NAME, LAST_NAME,
SALARY, COMMISSION_PCT, DEPARTMENT_NAME, JOB_TITLE, CITY,
STATE_PROVINCE, COUNTRY_NAME, REGION_NAME)
AS
SELECT
e.employee_id,
e.job_id,
e.manager_id,
e.department_id,
d.location_id,
l.country_id,
e.first_name,
e.last_name,
e.salary,
e.commission_pct,
d.department_name,
j.job_title,
l.city,
l.state_province,
c.country_name,
r.region_name
FROM
employees e,
departments d,
jobs j,
locations l,
countries c,
regions r
WHERE e.department_id = d.department_id
AND d.location_id = l.location_id
AND l.country_id = c.country_id
AND c.region_id = r.region_id
AND j.job_id = e.job_id
WITH READ ONLY;
2.2. SQL Tools
SQL Tools enable you to edit and run stored procedures and functions,as well as execute the so-called explain plans
in either graphic or text mode.
2.2.1. Using SQL Editor
To use an SQL Editor, do the following:
 In the DSE, navigate to the procedure or function you want to edit.
 Right-click the procedure or function and select Edit from the drop-down menu,as Figure 14 shows.
Figure 14. Editing Stored Procedure
The procedure or function opens in the SQL Editor, as Figure 15 shows.
Figure 15. SQL Editor
The SQL Editor enables standard text-based editing ofSQL statements,provides syntaxcolor, and multiple
statementsupport.
2.2.2. Executing a Stored Procedure or Function
To execute a stored procedure or function, do the following:
 In the DSE, navigate to the procedure or function you want to run.
 Right-click the procedure or function and select Run from the drop-down menu.
If the procedure or function has any input parameters,the Configure Parameters dialog appears,as Figure
16 shows.Enter inputvalues and click OK to run the procedure or function.
Figure 16. Configure Parameters Dialog
2.2.3. Executing Explain Plans
To execute the explain plan, do the following:
 In the Navigator or DSE, navigate to the scriptcontaining the SQL statementfor which you want to execute
an explain plan.
 Highlightthe script.
 Right-click on the selection and selecteither Execute Text Explain Plan or Execute Graphic Explain
Plan from the drop-down menu,as Figure 17 shows.
Figure 17. Executiong Explain Plan
For example,open the views.sql file that you created in the Generating DDL section.Highlight
the SELECT statementblock,as shown in Figure 19. Right-click and select Execute Graphic Explain Plan from the
drop-down menu.This opens the execution plan in graphic mode in the Execution Plan view, as Figure 18 shows.
Figure 18. Execution Plan - Graphical Mode
Alternatively, if you select Execute Text Explain Plan from the drop-down menu,itwill resultin a text version of the
execution plan,as Figure 19 demonstrates.
Figure 19. Execution Plan - Text Mode
2.3 Additional Features
There is a number ofother features that you can explore using the tool.
2.3.1 Granting Privileges
To grant specific database privileges to a specific user,do the following:
 In the DSE, navigate to the element(such as a table,for example) for which you want the user to have
certain privileges.
 Right-click the elementand select Grant Privileges from the drop-down menu,as Figure 20 shows.
Figure 20. Granting Privileges
This will open the Grant Privileges dialog,as Figure 21 shows.
Figure 21. Grant Privileges Dialog
Select one of the privileges from the listand click OK.
To revoke specific database privileges from a specific user,do the following:
 In the DSE, navigate to the element(such as a table,for example) for which you want to revoke the user
privileges.
 Right-click the elementand select Revoke Privileges from the drop-down menu.
This will open the Revoke Privileges dialog,as Figure 22 shows.
Figure 22. Revoke Privileges Dialog
Select one of the privileges from the listand click OK.
2.3.2 Creating Tables
Using the tool, you can create new database tables bydeclaring new columns,defining primary,unique,and foreign
keys, as well as adding checked constraints and indices.
To create a new database table,follow this procedure:
 In the DSE, navigate to the Tables element.
 Right-click the elementand select New Table from the drop-down menu,as Figure 23 shows.
Figure 23. Creating a New Table
This opens the Create Table dialog that Figure 24 shows.
Figure 24. Create Table Dialog
Even though by defaultthe table is created using the schema ofthe user who established the connection,
you can change the database schema.If the user who established the connection does nothave privileges
to create a new table in another schema,the SQL Result view will displayan error message after the wizard
completes.
 Using the Create Table dialog,specify the following:
o The name for your table.
o One or more table columns:to define a column,click Add, and then provide the column's name,
selectthe type using the Type dialog (see Figure 25), and specify whether or not the value can
be null.
Figure 25. Type Dialog
For each column,you can set data type as either a predefined SQL type, or a user-defined type.
Depending on the column type, the Details portion of the dialog (see Figure 26) displays different
settings.For example,for the NUMBER type, Details portion lets you specify the defaultvalue,
precision and scale;for VARCHAR2 type, you can specify the defaultvalue and size.
Figure 26. Completed Create Table Dialog
 You can reorder the table columns using the Move Up and Move Down buttons.
 Click Next on the Create Table dialog to open the Create Table > Primary Key dialog.On this dialog,
select Add primary key, and then define the name and selectone or more columns thatmake up the
primarykey, as Figure 27 shows.Ifa column type is not suitable as a primarykey column,a validation error
will be displayed.Proceed by clicking Next.
Figure 27. Primary Key Dialog
 On the next Create Table > Unique Constraints dialog that Figure 28 shows,define unique constraints for
the table by clicking Add. When defined,click Next to proceed.
Figure 28. Unique Constraints Dialog
There are three types of validation for the unique constraints:
o Each column mustbe suitable for unique constraints.For example,a column of type CLOB is not
suitable as a column in unique constraints.
o A unique constraintmustnotcontain the same columns as the primarykey.
o A unique constraintmustnot contain the same columns as another unique constraint.
 On the next Create Table > Foreign Keys dialog that Figure 29 shows,define foreign keys for the table by
clicking Add.
Note that foreign keys can reference the primarykey of a table which resides in another schema.You can
switch schemas byclicking Browse for the Referenced schema field.By clicking Browse for
the Referenced table field you can switch to different tables in the referenced schema.When the
referenced table is selected,the wizard will look up its primarykey and fill the Referenced constraint field if
the primarykey exist. It will also try to match the columns in the referenced table with columns in the new
table based on their types. Matched columns will show in the Associations table.If there are multiple
columns thatmatch a column in the referenced table, the wizard will choose the firstone it finds,which you
can change.
When finished,click Next.
Figure 29. Foreign Keys Dialog
 Using the next Create Table > Check Constraints dialog that Figure 30 shows,add checked constraints for
the new table by clicking Add.
Note that the Condition field is represented bya free-formatted text area.When using it, you have to ensure
that the text for the checked constraints conforms to PL/SQL syntax. Otherwise,you will not be able to set
the condition successfully.
When finished,click Next.
Figure 30. Check Constraints Dialog
 Use the next Create Table > Indices dialog that Figure 31 shows to add create indices for the new table by
clicking Add, and then click Next.
Figure 31. Indices Dialog
 The next Create Table > DDL dialog that Figure 32 shows summarizes the DDL used to create the new
table. You can make changes to the DDL before it is executed. Note that if you do make changes to the
DDL, and then go back to previous dialogs and decide to add a new column,then your changes to the DDL
will be lostand a new DDL will be generated..
Click Finish to complete the wizard.
Figure 31. DDL Dialog
Upon completion,the table creation DDL is sentto the JDBC driver and executed there. If the execution is
successful,a new table with all the specified constraints will be created.You can examine the resultof new table
creation from the SQL Result view that opens (see Figure 32).
Figure 32. SQL ResultView
Note that the table creation DDL is not executed as a single SQL statement.For any constraint,an ALTER
TABLE... statementis executed. If any of the ALTER TABLE statements fails,you have the option on whether or
not to continue to execute subsequentstatements.
If the newly created table is not displayed in the Tables node in Data Source Explorer, you will need to refresh the
view.
3. Known Issues
 Unable to sortfolders - this issue results in an inabilityto sortthe nodes on Data Source Explorer (DSE) in
an order that is consistentwith how it is displayed in Oracle SQL Developer.
4. Related Information
 Eclipse Data Tools Project
 Oracle Database 11g Release 1 Documentation
 Oracle Database 10g Express Edition Tutorial
 Oracle Database 10g Express Edition
 Eclipse Callisto ProjectProfile:Data Tools Platform
Copyright © 2008,
2011, Oracle. All rights reserved.
Eclipse Callisto Project Profile: Data Tools Platform
Nearly all J2EE applications use a relational database of some kind. Eclipse provides an
integrated set of tools for working with such databases in the Callisto Data Tools Platform.
by John Ferguson Smart
0 Google +0 0
Oct 16, 2006
Page 1 of 3
elational databases are a constant in today's development world. Despite
advances in alternative storage and indexing technologies, such as full-text searching
and indexing with Lucene and object-oriented and XML databases, the vast majority of
modern J2EE applications still work with at least one relational database in one form or another. Yet this
aspect of Java development has long been neglected in the standard Eclipse tool set, and developers
have had to look for third-party plug-ins or external tools for their database needs.
Eclipse 3.2 has changed all that. The Data Tools Platform (DTP), and to a lesser extent the Web Tools
Platform (WTP), both part of the new Callisto product suite released with Eclipse 3.2, provide a range of
data-centric tools, including JDBC connectivity, SQL querying, database browsing, and more.
DTP provides a comprehensive set of tools for data-centric development, including SQL querying
(including a visual SQL query modeler), execution plan analysis, and script history tracing. It also includes
a framework for editing and debugging queries and stored procedures, and it enables you to connect to
data sources other than relational ones. However, this promising project is still very much under
development; only a subset of these features is currently available. Currently in its 0.91 release, the
version 1.0 of DTP is scheduled for release in December 2006.
While the DTP project is devoted exclusively to data-centric development, the WTP project contains
mostly tools and editors for J2EE development. But some WTP tools concern database development as
well. This article looks at the tools provided by both these projects to make life easier when you work with
relational databases in a J2EE application.
Installing DTP and WTP
Although these tools are part of the Callisto package, they do not come with the standard Eclipse 3.2
installation out of the box. However, they are relatively straightforward to install. The simplest approach is
to use the remote update site, which is pre-configured in Eclipse 3.2. Go to the Remote Update window
("Help -> Software Updates -> Find and Install"), and select the "Callisto Discovery Site".
Eclipse will propose the full range of Callisto plug-ins and updates (see Figure 1). You will need to select
at least the following plug-ins, plus any others you may be interested in:
 Database development
 Enabling features
 Graphical editors and frameworks
 Models and model development
 Web and J2EE development
Alternatively, you can select all the Callisto tools, as they are all useful (with the possible exception, from
a Java developer's point of view, of "C and C++ development").
Figure 1. Installing DTP from the Remote Site
Once you have installed the DTP tools, you need to restart your IDE. You are now ready to take a look at
the main features of DTP and the database-oriented features of WTP. Some overlap currently exists
between the two projects. The first part of the article investigates the DTP tools, and the second part
examines WTP's database tools and how they compare to the ones in DTP.
- See more at: http://www.devx.com/Java/Article/32829?pf=true#sthash.OTM9fMYB.dpuf
Connecting to a Database Using DTP
The first thing you need to do in DTP is set up a connection to your target database. Open the
Preferences screen and choose "Connectivity -> Driver Definitions". DTP knows how to connect to a wide
range of databases, including DB2, Derby, MySQL Oracle, and Sybase, as well as a generic JDBC
connector.
Suppose you want to connect to a MySQL database. Choose the MySQL 4.1 entry and click on "Add".
This will open the "New Driver Entry" window (see Figure 2), in which you select a JDBC driver and
provide a name for your connection (you can have several connections of the same type to different
databases, identified by different names).
Figure 2. Creating a New Database Connection
Turning the Tide: Surviving (and Thriving in) the Software Developer Shortage
Download Now
Next, you fill in the details for this particular connection. If this is the first time you've added a connection
using this JDBC driver, you have to provide the path to the driver's jar file. And, not unreasonably, you
also need to provide the usual JDBC connection details, such as the connection URL, user ID, and
password (see Figure 3). Once this is done, your connection is ready for use!
Figure 3. Provide the Usual JDBC Connection Details
The Database DevelopmentPerspective
The DTP project provides a new perspective tailored for data-centric development: the Database
Development perspective. Open this perspective ("Window -> Open Perspective -> Other -> Database
Development"). One of its principal views is the Data Source Explorer, which lets you browse database
structures using a feature called a Connection Profile. Think of a Connection Profile as an instance of the
database connection you created previously. As you will see, you can either use a preexisting database
connection as the basis for a Connection Profile or create a new one entirely from scratch.
To create a new Connection Profile to the database you just set up, go to the "Databases" node in the
Data Source Explorer and choose "New..." in the contextual menu. This will open the "New Connection
Profile" screen, which proposes a choice between a connection to an embedded Derby database ("Derby -
Embedded Data") or a more general connection to a traditional JDBC database ("SQL Model – JDBC
Connection"). Choose the latter. You will be prompted to provide a name for your profile, and then to
enter the connection configuration details (see Figure 4).
Figure 4. Configuring the New Database Connection Profile
Here, you select one of the drivers configured in the Driver Definition screen as the basis for your
connection. You can also supply supplementary properties to the JDBC driver and test the connection.
When you're done, the new connection profile will appear in the Data Source Explorer. From here, you
can (as the name indicates) explore the structure of the database, which is represented in an intuitive
tree-view structure (see Figure 5).
Figure 5. Exploring a Database Structure
This view provides a comprehensive look at the database structure: tables, columns, stored procedures,
indexes, triggers, and so on. However, it is strictly read-only—no modification allowed. You can't query
the database from this view either (you will see how to query the database further on). The only exception
is you can run stored procedures from within this view. If your database has stored procedures, they will
be listed under the entry of the same name. To run a stored procedure, simply select it and choose
"Run..." in the contextual menu.
DTP Data Sources are not limited to relational databases. The ODA (Open Data Access) Data Sources
also provide access to data from other sources, such as CSV and XML files, or even custom data
sources.
- See more at: http://www.devx.com/Java/Article/32829/0/page/2#sthash.jhJw08pA.dpuf
Querying the Database
Being able to see the structure of the database is all well and good, but it is often useful to be able to see
inside the database as well. You may simply need to list the contents of a table, or you may want to test
and analyze the performance of complex SQL queries. The Callisto tools cater well to these needs as
well.
The basic tool for SQL querying in DTP is the SQL File editor, which provides syntax coloring and limited
auto-completion functionalities. Create a new SQL File (New -> Other... -> SQL Development -> SQL
File), and enter a query. When you have finished writing your query, use the "Set Connection Info" to
associate the SQL File with a given Database Connection Profile. Choose the "Generic JDBC" connection
profile type, and then select your connection profile and database names from the drop-down lists.
Now your query is ready to run. You can either use "Execute All" to run the entire script, or select just one
SQL statement and run "Execute Selected Text". This feature can be quite useful for debugging SQL
scripts.
Turning the Tide: Surviving (and Thriving in) the Software Developer Shortage
Download Now
Results are displayed in the "SQL Results" view (see Figure 6). Eclipse keeps a list of the queries you've
executed, along with their results, which is convenient for future reference. Results are displayed in a
convenient tabular form and can be sorted by each column.
Figure 6. A DTP Query
Another neat feature is the ability to export query results in a variety of formats: just select "Save" (to
export data to a file within your project) or "Export" (to export data anywhere else) in the contextual menu
in the results table.
Many other interesting tools are planned for the DTP project, including a visual SQL editor and an
Execution Plan analysis view. Although this project is still fairly recent, its scope is definitely ambitious. It
seems to promise great things.
Using the WTP Tools for Database Development
The Data Tools Platform is not the only Callisto project to provide database support. The Web Tools
Platform project also provides some interesting querying tools, which are definitely worth a look.
Unfortunately, in the current release, the database connections you configured earlier on for the Data
Source Explorer are not visible to the WTP tools, so you have to reconfigure a new WTP-friendly
connection. You do this in the "Database Explorer" view: use "New..." in the contextual menu to create a
new connection (see Figure 7). Entering a new connection is not the easiest of tasks. You need to
provide all the details (database, JDBC driver, connection URL, and so on) with little prompting or
assistance.
Figure 7. Setting Up a WTP JDBC Connection
If creating a new WTP-style connection is a little less user-friendly than in DTP, the results in the
Database Explorer view (see Figure 8) makes it worth it. This view presents the database structure in a
hierarchical format like the Data Source Explorer, but with many more possibilities than the DTP
equivalent.
Figure 8. The Database Explorer View
In addition to browsing through the structure of the database, you can actively query the contents. By
simply right-clicking on a table or column, you can display a subset of the table data using the "Data ->
Sample Contents" entry. If you have sufficient rights, you can modify the database structure by dropping
columns or even entire tables. You can also display the SQL used to create the table, export or import
data, or even edit the contents of the table (using "Data -> Edit").
WTP also provides an alternative way to run ad-hoc SQL queries: the SQL Scrapbook. Create a new
SQL Scrapbook ("File -> New -> Other -> Data -> SQL Scrapbook Page") and enter a SQL query. The
SQL Scrapbook provides SQL syntax coloring, but does not support auto-completion. You can associate
a connection using the contextual menu ("Use Database Connection"). Run the query with "Run SQL".
Query results appear in the "Data Output" view.
Although similar to the DTP SQL Page, the WTP SQL Scrapbook feature is somewhat less sophisticated.
Results cannot be sorted, for example, nor can you execute a selected query within the scrapbook.
DTP Tools Ambitious in Scope
Eclipse 3.2 and Callisto offer a number of powerful tools for database-oriented development activities with
the WTP and DTP toolsets. The two projects overlap considerably, but the WTP tools are mature and
feature rich while the DTP tools are more ambitious in scope. So WTP probably will meet the needs of
many of today's Java developers, and DTP will become the reference tool set for database development
under Eclipse.
However, both objectively are still quite young, with many enticing features promised for future versions.
Nevertheless, in areas such as ad-hoc querying, the DTP functionality already out-does its WTP
equivalent. All in all, if you need to work with relational databases in your Java application development
project, both of these tool sets are definitely worth a look.
- See more at: http://www.devx.com/Java/Article/32829/0/page/3#sthash.dwCgmUkA.dpuf
Getting Started With the Oracle Database Plugin for Eclipse
1. Introduction
2. Using the Tool
1. Database Explorer
1. Connecting to an Oracle Database
2. Exploring an Oracle Database
3. Editing Data from a Table
4. Loading Data into a Table
5. Extracting Data from a Table
6. Generating DDL
2. SQL Tools
1. Using SQL Editor
2. Executing a Stored Procedure or Function
3. Executing Explain Plan
3. Additional Features
1. Granting Privileges
2. Creating Tables
3. Known Issues
4. Related Information
1. Introduction
Welcome to the firststep towards supporting the Eclipse Data Tool Platform (DTP) by Oracle. This document
provides a high-level tour through each of the Oracle Database Plugin features.
Note that screen shots and examples in this document use the HR schema that is installed by
default with Oracle Database. You may use Oracle Database 11g Release 1, or download
Oracle Database 10g Express Edition - Free Download.
2. Using the Tool
2.1. Database Explorer
The Database Explorer is the Datasource View provided by the DTP. You use it to create Database connections and
to navigate the database.
2.1.1. Connecting to an Oracle Database
You can create a connection to a database using the Data Source Explorer view, as follows:
1. To open the Database Developmentperspective,click Windows > Open Perspective > Other from the
Main menu,and then select Database Development from the Open Perspective dialog.This perspective
opens the Data Source Explorer (DSE) view.
Figure 1. Opening Database Perspective
2. Rightclick on the Databases node in DSE and select New... to create a database connection,as Figure
2 shows.
Figure 2. New Database Connection
This displays the New Connection Profile wizard, as Figure 3 shows.
Figure 3. New Connection Profile Dialog
3. Select Oracle Database Connection from the listand provide a name for the connection.Click Next to
proceed to the next step.
4. Complete the restof the dialog as follows:
o Select either Oracle Database 10g Driver Default or Oracle Database 11g Driver Default from
the drop-down listofdrivers, as Figure 4 shows.
o If the defaultsettings are not appropriate for your configuration,change the following information on
the Properties > General tab of the New Connection Profile dialog:
 In the SID field,replace xe with the Service Name (or SID) of the Database Service.
 In the Host field, replace server with the hostname or IP address ofthe Oracle Database
server (possiblylocalhost).
 In the Port number field, replace 1521 with the port number of the Oracle Database
Listener service.
 Provide the database user name and password for the connection.
Note that the Connection URL field reflects your changes.
 Select a use group in the Catalog field.
o On the Properties > Optional tab, setthe following optional properties,ifrequired:
 autocommit=false
By default, autocommitis setto true, which results in immediate commitofthe
operations from SQL Editor. When setto false, you need to execute the
explicit COMMIT to committhe changes.See Oracle Database SQL Reference for more
information.
 sysdba=true
Use this property to login with SYSDBA account.
 sysoper=true
Use this property to login with SYSOPER account.
o Click Test Connection to test the connectivity. If this fails,try restarting Eclipse with -
clean command option.
o Select Connect when the wizard completes checkbox to enable the database connection.
o Select Finish to complete the wizard.
Figure 4. Database Connection Details
2.1.2. Exploring the Oracle Database
The open database connection allows you to navigate through the database objects.
Figure 5. Exploring the Database
2.1.3. Editing Data from a Table
With the enabled database connection,you can edit the table data in the Data Source Explorer (DSE).
Note that, for comprehensive editing capabilities,itis recommended thatyou install Data Tools Platform SQL
DevelopmentTools Data Functions feature,as follows:
 If your machine is located inside ofa network,which requires a proxy to access outside resource such as
the Internet, the configuration (download) mayfail due to the fact that Eclipse IDE includes a Web browser
to let you access the Internet from within the IDE. In this case,reconfigure your Eclipse IDE proxy settings
using Window > Preferences > General > Network Connections.
 Select Help > Software Updates from the main menu.
 Open the Available Software tab on the Software Updates and Add-ons dialog.
 Click Add Site to install the feature provided by OEPE from OEPE's update site.To do so,
enter http://www.oracle.com/technology/software/products/oepe/oepe_12g.htm
l in the Location field of the Add Site dialog,and then click OK.
 Expand the Ganymede Update Site node, and then expand the Database Development node.Select Data
Tools Platform SQL Development Tools Data Functions, and then click Install.
To edit a table data, navigate to the table you wantto editin the DSE, then right-click the table, and select Data >
Edit, as Figure 6 shows.
Figure 6. Editing Database Table
This opens the table data in the editor, as Figure 7 shows.You can make changes to the table data by right-clicking
on a table cell and using the popup menu.When you have finished editing,click Save to save the changes to the
database.
Figure 7. Database Table Editor
2.1.4. Loading Data into a Table
To load data into a table from a text file, in the DSE, navigate to the table into which you want to load data. Right-click
the table, and select Data > Load from the drop-down menu,as Figure 8 show.
Figure 8. Loading Data
This opens the Load Data dialog,as Figure 9 shows.Complete fields on the dialog,and then click Finish.
Figure 9. Load Data Dialog
Note that this may fail if there is a foreign key violation.
2.1.5. Extracting Data from a Table
To extract data from a table to a text file, in the DSE, navigate to the table from which you want to extract data. Right-
click the table and select Data > Extract from the drop-down menu,as Figure 10 shows.
Figure 10. Extracting Data
This opens the Extract Data dialog,as Figure 11 shows.Complete fields on the dialog,and then click Finish.
Figure 11. Extract Data Dialog
2.1.6. Generating DDL
You can use the Generate DDL option on mostdatabase objects to create or drop the object.
In the DSE, navigate to the objectyou want to create or drop,right-click the object, and select Generate DDL from
the drop-down menu to create a DDL script,as Figure 12 and Figure 13 show.
Note that you need to create a projectin order to save the generated DDL script.See Creating a project for more
details.
Figure 12. Generate DDL
Figure 13. Generating DDL
The preceding steps generate the following statements:
CREATE VIEW EMP_DETAILS_VIEW
(EMPLOYEE_ID, JOB_ID, MANAGER_ID,
DEPARTMENT_ID, LOCATION_ID, COUNTRY_ID, FIRST_NAME, LAST_NAME,
SALARY, COMMISSION_PCT, DEPARTMENT_NAME, JOB_TITLE, CITY,
STATE_PROVINCE, COUNTRY_NAME, REGION_NAME)
AS
SELECT
e.employee_id,
e.job_id,
e.manager_id,
e.department_id,
d.location_id,
l.country_id,
e.first_name,
e.last_name,
e.salary,
e.commission_pct,
d.department_name,
j.job_title,
l.city,
l.state_province,
c.country_name,
r.region_name
FROM
employees e,
departments d,
jobs j,
locations l,
countries c,
regions r
WHERE e.department_id = d.department_id
AND d.location_id = l.location_id
AND l.country_id = c.country_id
AND c.region_id = r.region_id
AND j.job_id = e.job_id
WITH READ ONLY;
2.2. SQL Tools
SQL Tools enable you to edit and run stored procedures and functions,as well as execute the so-called explain plans
in either graphic or text mode.
2.2.1. Using SQL Editor
To use an SQL Editor, do the following:
 In the DSE, navigate to the procedure or function you want to edit.
 Right-click the procedure or function and select Edit from the drop-down menu,as Figure 14 shows.
Figure 14. Editing Stored Procedure
The procedure or function opens in the SQL Editor, as Figure 15 shows.
Figure 15. SQL Editor
The SQL Editor enables standard text-based editing ofSQL statements,provides syntaxcolor, and multiple
statementsupport.
2.2.2. Executing a Stored Procedure or Function
To execute a stored procedure or function, do the following:
 In the DSE, navigate to the procedure or function you want to run.
 Right-click the procedure or function and select Run from the drop-down menu.
If the procedure or function has any input parameters,the Configure Parameters dialog appears,as Figure
16 shows.Enter inputvalues and click OK to run the procedure or function.
Figure 16. Configure Parameters Dialog
2.2.3. Executing Explain Plans
To execute the explain plan, do the following:
 In the Navigator or DSE, navigate to the scriptcontaining the SQL statementfor which you want to execute
an explain plan.
 Highlightthe script.
 Right-click on the selection and selecteither Execute Text Explain Plan or Execute Graphic Explain
Plan from the drop-down menu,as Figure 17 shows.
Figure 17. Executiong Explain Plan
For example,open the views.sql file that you created in the Generating DDL section.Highlight
the SELECT statementblock,as shown in Figure 19. Right-click and select Execute Graphic Explain Plan from the
drop-down menu.This opens the execution plan in graphic mode in the Execution Plan view, as Figure 18 shows.
Figure 18. Execution Plan - Graphical Mode
Alternatively, if you select Execute Text Explain Plan from the drop-down menu,itwill resultin a text version of the
execution plan,as Figure 19 demonstrates.
Figure 19. Execution Plan - Text Mode
2.3 Additional Features
There is a number ofother features that you can explore using the tool.
2.3.1 Granting Privileges
To grant specific database privileges to a specific user,do the following:
 In the DSE, navigate to the element(such as a table,for example) for which you want the user to have
certain privileges.
 Right-click the elementand select Grant Privileges from the drop-down menu,as Figure 20 shows.
Figure 20. Granting Privileges
This will open the Grant Privileges dialog,as Figure 21 shows.
Figure 21. Grant Privileges Dialog
Select one of the privileges from the listand click OK.
To revoke specific database privileges from a specific user,do the following:
 In the DSE, navigate to the element(such as a table,for example) for which you want to revoke the user
privileges.
 Right-click the elementand select Revoke Privileges from the drop-down menu.
This will open the Revoke Privileges dialog,as Figure 22 shows.
Figure 22. Revoke Privileges Dialog
Select one of the privileges from the listand click OK.
2.3.2 Creating Tables
Using the tool, you can create new database tables bydeclaring new columns,defining primary,unique,and foreign
keys, as well as adding checked constraints and indices.
To create a new database table,follow this procedure:
 In the DSE, navigate to the Tables element.
 Right-click the elementand select New Table from the drop-down menu,as Figure 23 shows.
Figure 23. Creating a New Table
This opens the Create Table dialog that Figure 24 shows.
Figure 24. Create Table Dialog
Even though by defaultthe table is created using the schema ofthe user who established the connection,
you can change the database schema.If the user who established the connection does nothave privileges
to create a new table in another schema,the SQL Result view will displayan error message after the wizard
completes.
 Using the Create Table dialog,specify the following:
o The name for your table.
o One or more table columns:to define a column,click Add, and then provide the column's name,
selectthe type using the Type dialog (see Figure 25), and specify whether or not the value can
be null.
Figure 25. Type Dialog
For each column,you can set data type as either a predefined SQL type, or a user-defined type.
Depending on the column type, the Details portion of the dialog (see Figure 26) displays different
settings.For example,for the NUMBER type, Details portion lets you specify the defaultvalue,
precision and scale;for VARCHAR2 type, you can specify the defaultvalue and size.
Figure 26. Completed Create Table Dialog
 You can reorder the table columns using the Move Up and Move Down buttons.
 Click Next on the Create Table dialog to open the Create Table > Primary Key dialog.On this dialog,
select Add primary key, and then define the name and selectone or more columns thatmake up the
primarykey, as Figure 27 shows.Ifa column type is not suitable as a primarykey column,a validation error
will be displayed.Proceed by clicking Next.
Figure 27. Primary Key Dialog
 On the next Create Table > Unique Constraints dialog that Figure 28 shows,define unique constraints for
the table by clicking Add. When defined,click Next to proceed.
Figure 28. Unique Constraints Dialog
There are three types of validation for the unique constraints:
o Each column mustbe suitable for unique constraints.For example,a column of type CLOB is not
suitable as a column in unique constraints.
o A unique constraintmustnotcontain the same columns as the primarykey.
o A unique constraintmustnot contain the same columns as another unique constraint.
 On the next Create Table > Foreign Keys dialog that Figure 29 shows,define foreign keys for the table by
clicking Add.
Note that foreign keys can reference the primarykey of a table which resides in another schema.You can
switch schemas byclicking Browse for the Referenced schema field.By clicking Browse for
the Referenced table field you can switch to different tables in the referenced schema.When the
referenced table is selected,the wizard will look up its primarykey and fill the Referenced constraint field if
the primarykey exist. It will also try to match the columns in the referenced table with columns in the new
table based on their types. Matched columns will show in the Associations table.If there are multiple
columns thatmatch a column in the referenced table, the wizard will choose the firstone it finds,which you
can change.
When finished,click Next.
Figure 29. Foreign Keys Dialog
 Using the next Create Table > Check Constraints dialog that Figure 30 shows,add checked constraints for
the new table by clicking Add.
Note that the Condition field is represented bya free-formatted text area.When using it, you have to ensure
that the text for the checked constraints conforms to PL/SQL syntax. Otherwise,you will not be able to set
the condition successfully.
When finished,click Next.
Figure 30. Check Constraints Dialog
 Use the next Create Table > Indices dialog that Figure 31 shows to add create indices for the new table by
clicking Add, and then click Next.
Figure 31. Indices Dialog
 The next Create Table > DDL dialog that Figure 32 shows summarizes the DDL used to create the new
table. You can make changes to the DDL before it is executed. Note that if you do make changes to the
DDL, and then go back to previous dialogs and decide to add a new column,then your changes to the DDL
will be lostand a new DDL will be generated..
Click Finish to complete the wizard.
Figure 31. DDL Dialog
Upon completion,the table creation DDL is sentto the JDBC driver and executed there. If the execution is
successful,a new table with all the specified constraints will be created.You can examine the resultof new table
creation from the SQL Result view that opens (see Figure 32).
Figure 32. SQL ResultView
Note that the table creation DDL is not executed as a single SQL statement.For any constraint,an ALTER
TABLE... statementis executed. If any of the ALTER TABLE statements fails,you have the option on whether or
not to continue to execute subsequentstatements.
If the newly created table is not displayed in the Tables node in Data Source Explorer, you will need to refresh the
view.
3. Known Issues
 Unable to sortfolders - this issue results in an inabilityto sortthe nodes on Data Source Explorer (DSE) in
an order that is consistentwith how it is displayed in Oracle SQL Developer.
4. Related Information
 Eclipse Data Tools Project
 Oracle Database 11g Release 1 Documentation
 Oracle Database 10g Express Edition Tutorial
 Oracle Database 10g Express Edition
 Eclipse Callisto ProjectProfile:Data Tools Platform
Copyright © 2008,
2011, Oracle. All rights reserved.







Database Development in
Eclipse with the Data Tools
Platform (DTP)
Published February 11,2008
Filed under
 Databases,
 Eclipse
I'm getting lazier. I mean lazy like looking for 10 minutes for a lost TV remote rather
than getting off the couch to change the channel. Sure, it's not a big deal to switch
back and forth between Eclipse and the MySQL Query Browser or phpMyAdmin, but
those seconds add up.
In this post I'll show you how to take advantage of another part of the "I" in the Eclipse
"IDE".
The Eclipse Data Tools Platform (DTP) is a standard Eclipse plugin that you can use to
perform most database development and query functions. The DTP plugin supports
several database platforms via JDBC, including Derby, Oracle, MS SQL, Postgres,
Sybase ASA, Flat Files, XML Data, Web Services, and more. This post covers
connecting to MySQL and basic DTP features.
Requirements
I'll assume that you're comfortable installing Eclipse and Eclipse plugins . I'm also
assuming that you've used Eclipse for a bit and have at least one project defined.
Here's what you'll need before we get started.
 Eclipse with the DTP plugin, I'm running Eclipse 3.3 which came bundled with DTP
version 1.5.0.
 MySQL JDBC Driver, I'm using Connect/J 5.1.
 MySQL Server version 4 or 5 running on localhost or a remote host that allows
remote connections.
 MySQL user account with a database or privileges to create databases.
Install a JDBC Driver
Installing Eclipse and DTP does not install JDBC drivers. You must install the
appropriate driver for the database server you're using. You can usually get drivers from
the vendor. I downloaded the MySQL Connector/J.
1. Visit http://dev.mysql.com/downloads/connector/
2. Select 'Connector/J' in the left menu, then select a version. I used version 5.1.
3. Download the source and binaries and save somewhere that makes sense for your
OS. I dropped mine in /Library/Java/Extensions on my Mac.
Create a Driver Template and
Connection Profile
Next, create a driver template and a connection profile. You'll be able to reuse this
template when creating future connection profiles.
1. Select File > New > Other
2. Expand Connection Profiles and select Connection Profile, Next >
3. Select Generic JDBC Connection, Next >
4. Name the Connection Profile for the host and database to which you're connecting
(i.e. localhost.database), Next >
5. Click on the ... button to add your JDBC driver to the Select a driver dropdown
menu.
1. Select the appropriate folder for your database JDBC driver version, I
selected MySQL > 5.1, Click Add...
2. Expand the Available Driver Templates folders, select "MySQL JDBC Driver"
3. Add the driver version to the Driver Name, I changed mine to "MySQL JDBC
Driver 5.1"
Note: Don't be confused by differences in server and driver versions. You
can use the 5.1 driver to connect to MySQL 4.x.
4. Check "Edit New Driver Definition Immediately", click OK
6. Eclipse will display an "Unable to locate jar/zip..." message. Tell Eclipse where the
JDBC driver is.
1. Select the driver file in the list, click the "Edit Jar/Zip" button
2. Browse to and open your JDBC driver. I placed mine at
/Library/Java/Extensions/mysql-connector-java-5.1.5/mysql-connector-java-
5.1.5-bin.jar
3. Set your Connection URL, Database Name, Password, and User ID in the
Properties pane, click OK
7. Your Driver template now appears in the Available Driver Definitions list, select it,
click OK
8. Add Optional Properties to those you just set or check the "Save Password" box if
you'd like.
9. Click the "Test Connection" button, hopefully your Ping succeeded! If not, double
check your connection properties.
10.Click Finish
Open DTP's Database Development
Perspective
With a connection template and profile defined, open up the Database Development
Perspective, if it isn't already open.
1. Select Window > Open Perspective > Other...
2. Select Database Development, click OK
Establish a Database Connection
1. In the Data Source Explorer pane, expand the Database folder.
2. Right-click on the Connection Profile and select Connect
3. You should now see folders for table, stored procedures, views, and other objects
supported by your database platform.
4. If you have tables in your database, expand to view columns.
Create and Execute SQL Files
You can create and modify tables, triggers, stored procedures directly via DTP. Before
proceeding, open an existing or create a new Eclipse project. You'll save SQL files to an
existing project which makes it easy to place them under version control with the rest of
your application files.
1. Select File > New > SQL File (or File > New > Other > SQL Development > SQL
File).
2. Choose the project and folder where you'll save the file.
3. Select the Database server type, Connection profile, and Database name. You can
skip specifying the database if you're going to create one with the file.
4. Click Finish
5. Type in the SQL you'd like to run.
6. Select all, or a portion, of the SQL to run.
7. Right-click in the document tab and select either Execute All or Execute Selected
Text.
8. Review the SQL Results at the bottom of the SQL Development Perspective.
The buttons in the SQL Results tab allow you to track the status for all SQL executed
and provide a handy filter for sifting through results.
Insert and Edit Data
1. Expand Databases > Host > YourDatabase > Schemas in the Data Source
Explorer
2. Right-click on a table and select Data > Edit
3. An editor tab appears with the table's columns, enter one or many records into the
rows provided
4. Right-click anywhere in the editor panel and select save
Easy, isn't it? You probably noticed other nifty features under the Data menu, including
Load and Extract. These options allow you to import and export delimitied data from
files.
Conclusion
Overall I'm very happy with DTP. It's been a bit of an adjustment getting used to how
things are done, but I no longer have to get off the Eclipse "couch" to take care of SQL
development tasks. I've covered most of the basics here but I think you'll find several
other useful features. Happy data developing!
Related Links
 Using the Eclipse Data Tools Platform with PowerBuilder and SQL Anywhere
 Getting Started with DTP from the Eclipse Wiki
 EclipseCon 2007 DTP Related Sessions
 Eclipse Data Tools Platform (DTP)
 Previous article ›
Firefox 3 Can't Come Soon Enough
 ‹ Next article

More Related Content

What's hot

Implementingand Administering Windows Share Point Services3.0
Implementingand Administering Windows Share Point Services3.0Implementingand Administering Windows Share Point Services3.0
Implementingand Administering Windows Share Point Services3.0LiquidHub
 
Sharepoint 2010 mcq
Sharepoint 2010 mcqSharepoint 2010 mcq
Sharepoint 2010 mcqAnuja Sharma
 
Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2nesmaddy
 
Toad fororacle createconnections
Toad fororacle createconnectionsToad fororacle createconnections
Toad fororacle createconnectionsEfren
 
Oracle10g External Tables
Oracle10g External TablesOracle10g External Tables
Oracle10g External TablesKai Liu
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan► Supreme Mandal ◄
 
Murach: How to use Entity Framework EF Core
Murach: How to use Entity Framework EF  CoreMurach: How to use Entity Framework EF  Core
Murach: How to use Entity Framework EF CoreMahmoudOHassouna
 
Hands-On Lab Data Transformation Services - SQL Server
Hands-On Lab Data Transformation Services - SQL ServerHands-On Lab Data Transformation Services - SQL Server
Hands-On Lab Data Transformation Services - SQL ServerSerra Laercio
 
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...WithTheBest
 
Access2007
Access2007Access2007
Access2007aditu_7
 
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 BookADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 BookMuralidharan Radhakrishnan
 

What's hot (19)

Implementingand Administering Windows Share Point Services3.0
Implementingand Administering Windows Share Point Services3.0Implementingand Administering Windows Share Point Services3.0
Implementingand Administering Windows Share Point Services3.0
 
Sharepoint 2010 mcq
Sharepoint 2010 mcqSharepoint 2010 mcq
Sharepoint 2010 mcq
 
Plsql 9i vol2
Plsql 9i vol2Plsql 9i vol2
Plsql 9i vol2
 
Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2
 
Toad fororacle createconnections
Toad fororacle createconnectionsToad fororacle createconnections
Toad fororacle createconnections
 
Oracle10g External Tables
Oracle10g External TablesOracle10g External Tables
Oracle10g External Tables
 
D space manual-1_8
D space manual-1_8D space manual-1_8
D space manual-1_8
 
hw4_specifications
hw4_specificationshw4_specifications
hw4_specifications
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan
 
Murach: How to use Entity Framework EF Core
Murach: How to use Entity Framework EF  CoreMurach: How to use Entity Framework EF  Core
Murach: How to use Entity Framework EF Core
 
Sq lite manager
Sq lite managerSq lite manager
Sq lite manager
 
Hands-On Lab Data Transformation Services - SQL Server
Hands-On Lab Data Transformation Services - SQL ServerHands-On Lab Data Transformation Services - SQL Server
Hands-On Lab Data Transformation Services - SQL Server
 
ssis lab
ssis labssis lab
ssis lab
 
Testing File
Testing FileTesting File
Testing File
 
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
 
Ad installation
Ad installationAd installation
Ad installation
 
Access2007
Access2007Access2007
Access2007
 
Sap basis made easy
Sap basis made easySap basis made easy
Sap basis made easy
 
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 BookADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
 

Viewers also liked

Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAravindharamanan S
 
Content based recommendation systems
Content based recommendation systemsContent based recommendation systems
Content based recommendation systemsAravindharamanan S
 
Android chapter18 c-internet-web-services
Android chapter18 c-internet-web-servicesAndroid chapter18 c-internet-web-services
Android chapter18 c-internet-web-servicesAravindharamanan S
 
Combining content based and collaborative filtering
Combining content based and collaborative filteringCombining content based and collaborative filtering
Combining content based and collaborative filteringAravindharamanan S
 
Sun==big data analytics for health care
Sun==big data analytics for health careSun==big data analytics for health care
Sun==big data analytics for health careAravindharamanan S
 
Introduction to recommendation system
Introduction to recommendation systemIntroduction to recommendation system
Introduction to recommendation systemAravindharamanan S
 
Personalizing the web building effective recommender systems
Personalizing the web building effective recommender systemsPersonalizing the web building effective recommender systems
Personalizing the web building effective recommender systemsAravindharamanan S
 
Big data-analytics-2013-peer-research-report
Big data-analytics-2013-peer-research-reportBig data-analytics-2013-peer-research-report
Big data-analytics-2013-peer-research-reportAravindharamanan S
 

Viewers also liked (15)

Sql developer usermanual_en
Sql developer usermanual_enSql developer usermanual_en
Sql developer usermanual_en
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codes
 
uae views on big data
  uae views on  big data  uae views on  big data
uae views on big data
 
Content based recommendation systems
Content based recommendation systemsContent based recommendation systems
Content based recommendation systems
 
Cs548 s15 showcase_web_mining
Cs548 s15 showcase_web_miningCs548 s15 showcase_web_mining
Cs548 s15 showcase_web_mining
 
Rest hello world_tutorial
Rest hello world_tutorialRest hello world_tutorial
Rest hello world_tutorial
 
Android chapter18 c-internet-web-services
Android chapter18 c-internet-web-servicesAndroid chapter18 c-internet-web-services
Android chapter18 c-internet-web-services
 
Combining content based and collaborative filtering
Combining content based and collaborative filteringCombining content based and collaborative filtering
Combining content based and collaborative filtering
 
Sun==big data analytics for health care
Sun==big data analytics for health careSun==big data analytics for health care
Sun==big data analytics for health care
 
Introduction to recommendation system
Introduction to recommendation systemIntroduction to recommendation system
Introduction to recommendation system
 
Full xml
Full xmlFull xml
Full xml
 
Personalizing the web building effective recommender systems
Personalizing the web building effective recommender systemsPersonalizing the web building effective recommender systems
Personalizing the web building effective recommender systems
 
Tomcat + other things
Tomcat + other thingsTomcat + other things
Tomcat + other things
 
Chapter 2 research methodlogy
Chapter 2 research methodlogyChapter 2 research methodlogy
Chapter 2 research methodlogy
 
Big data-analytics-2013-peer-research-report
Big data-analytics-2013-peer-research-reportBig data-analytics-2013-peer-research-report
Big data-analytics-2013-peer-research-report
 

Similar to Database development connection steps

OBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation StepsOBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation StepsDharmaraj Borse
 
Creating a repository using the oracle business intelligence administration tool
Creating a repository using the oracle business intelligence administration toolCreating a repository using the oracle business intelligence administration tool
Creating a repository using the oracle business intelligence administration toolRavi Kumar Lanke
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Cathie101
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Aeric Poon
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universitylhkslkdh89009
 
Style Intelligence Evaluation Documentation
Style Intelligence Evaluation DocumentationStyle Intelligence Evaluation Documentation
Style Intelligence Evaluation DocumentationArleneWatson
 
Aggregate persistence wizard
Aggregate persistence wizardAggregate persistence wizard
Aggregate persistence wizardreturnasap
 
Generic steps in informatica
Generic steps in informaticaGeneric steps in informatica
Generic steps in informaticaBhuvana Priya
 
Rdbms Practical file diploma
Rdbms Practical file diploma Rdbms Practical file diploma
Rdbms Practical file diploma mustkeem khan
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#Michael Heron
 
ConnectSMART Tutorials
ConnectSMART TutorialsConnectSMART Tutorials
ConnectSMART TutorialsConnectSMART
 
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...Mumbai B.Sc.IT Study
 
Multiple files single target single interface
Multiple files single target single interfaceMultiple files single target single interface
Multiple files single target single interfaceDharmaraj Borse
 
Project Presentation
Project PresentationProject Presentation
Project PresentationShariffAyesha
 

Similar to Database development connection steps (20)

OBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation StepsOBIEE 11g : Repository Creation Steps
OBIEE 11g : Repository Creation Steps
 
Creating a repository using the oracle business intelligence administration tool
Creating a repository using the oracle business intelligence administration toolCreating a repository using the oracle business intelligence administration tool
Creating a repository using the oracle business intelligence administration tool
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0
 
154090896 installation-of-oracle-database-12c
154090896 installation-of-oracle-database-12c154090896 installation-of-oracle-database-12c
154090896 installation-of-oracle-database-12c
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry university
 
Database Connection
Database ConnectionDatabase Connection
Database Connection
 
Style Intelligence Evaluation Documentation
Style Intelligence Evaluation DocumentationStyle Intelligence Evaluation Documentation
Style Intelligence Evaluation Documentation
 
Mule data bases
Mule data basesMule data bases
Mule data bases
 
Aggregate persistence wizard
Aggregate persistence wizardAggregate persistence wizard
Aggregate persistence wizard
 
Generic steps in informatica
Generic steps in informaticaGeneric steps in informatica
Generic steps in informatica
 
Rdbms Practical file diploma
Rdbms Practical file diploma Rdbms Practical file diploma
Rdbms Practical file diploma
 
Dbi h315
Dbi h315Dbi h315
Dbi h315
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
 
Db2 tutorial
Db2 tutorialDb2 tutorial
Db2 tutorial
 
Oracle ADF 11g Tutorial
Oracle ADF 11g TutorialOracle ADF 11g Tutorial
Oracle ADF 11g Tutorial
 
ConnectSMART Tutorials
ConnectSMART TutorialsConnectSMART Tutorials
ConnectSMART Tutorials
 
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
Data Warehousing (Practical Questions Paper) [CBSGS - 75:25 Pattern] {2015 Ma...
 
Multiple files single target single interface
Multiple files single target single interfaceMultiple files single target single interface
Multiple files single target single interface
 
Project Presentation
Project PresentationProject Presentation
Project Presentation
 

Recently uploaded

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

Database development connection steps

  • 1. Scout/Tutorial/3.8/Database Development Perspective < Scout | Tutorial | 3.8 Scout Wiki Home Website Download • Git Community Forums • Blog • Twitter • G+ Bugzilla Bugzilla Contents [hide]  1 Configure the Database Development View o 1.1 Install Database Development o 1.2 Add new Derby Connection o 1.3 Specify Driver Details o 1.4 Access the Derby database on the Command Line Configure the Database Development View This page shows how to install, configure and use the database development view in eclipse. Alternatively, using and browsing Derby databases on the command line is shown at the end Install Database Development
  • 2. If you have not yet installed the database development package use menu Help and then Install New Software.... On Install dialog fill the Work with drop-down list with --All Available Sites-- and tick the checkbox Database Development Step through the install dialog and restart your Eclipse Add new Derby Connection Open the Database Development perspective, right click on Database Connections and call the wizard for adding a new database connection by clicking on the context menu New....
  • 3. From the list of available connection profiles, choose Derby.
  • 4. Specify Driver Details Open the driver deteail editor by clicking on the round icon to the right of the Drivers combobox.
  • 5. Choose the embedded derby driver for version 10.2. Go to the tab Jar List and there specify the location of the derby.jar. If you don't have any, download it (from the official derby website: http://db.apache.org/derby/, it's inside the zip file) or download the TutorialMiniCrmWorkspaceDerbyDB and click on ok to leave this page.
  • 6.
  • 7.
  • 8. Add the path to your DerbyDb along with the login data (for the minicrm: minicrm/minicrm).
  • 9. When you have entered all the required data, click on Test connection in order to test the connection details you just entered. If everything is fine there will be a message box Ping succeeded.
  • 10. Now you can browse through the DerbyDB, modify tables, data, run statements and much more. Please be aware that you cannot have more than one connection to your DerbyDb, therefore either you browse through it in the database development view or you access it using the minicrm, therefore you need to manually disconnect from the database before you can run your application.
  • 11.
  • 12. Access the Derby database on the Command Line Change to the library folder of your Derby installation, then type the following in the DOS shell to connect to your database. C:DerbyDBdb-derby-10.6.2.1-binlib>java -classpath derby.jar;derbytools.jar org.ap ache.derby.tools.ij ij version 10.6 ij> connect 'jdbc:derby:c:/derbydb'; Remark: For the above example the derby installation is found under C:DerbyDBdb-derby-10.6.2.1- bin and the data base is stored directly under C:DerbyDB Troubleshooting If you get an error message similar to ERROR XJ040: Failed to start database 'c:/derbydb' with class loader sun.misc.Launcher$AppClassLoader... ERROR XSDB6: Another instance of Derby may have already booted the database C:DerbyDB
  • 13. you might still have your Scout server running that is accessing the database. If so, stop the server in the Scout perspective and try again. Once connected you may browse, change, ... ij> show schemas; TABLE_SCHEM ------------------------------ APP MINICRM ... ij> show tables in minicrm; TABLE_SCHEM |TABLE_NAME |REMARKS ------------------------------------------------------------------------ MINICRM |COMPANY | MINICRM |COMPANY_FIGURES | MINICRM |CRM_SEQ | ... ij> describe minicrm.company; COLUMN_NAME |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL& ------------------------------------------------------------------------------ COMPANY_NR |DECIMAL |0 |10 |5 |NULL |NULL |NO SHORT_NAME |VARCHAR |NULL|NULL|60 |NULL |120 |NO ... Finally ij> disconnect; ij> exit; Category:  Scout Tutorial 3.8
  • 14. Getting Started With the Oracle Database Plugin for Eclipse 1. Introduction 2. Using the Tool 1. Database Explorer 1. Connecting to an Oracle Database 2. Exploring an Oracle Database 3. Editing Data from a Table 4. Loading Data into a Table 5. Extracting Data from a Table 6. Generating DDL 2. SQL Tools 1. Using SQL Editor 2. Executing a Stored Procedure or Function 3. Executing Explain Plan 3. Additional Features 1. Granting Privileges 3. Known Issues 4. Further Resources 1. Introduction Welcome to the firststep towards supporting the Eclipse Data Tool Platform (DTP) by Oracle. This document provides a high-level tour through each of the Oracle Database Plugin features. Note that screen shots and examples in this document use the HR schema that is installed by default with Oracle Database. You may download Oracle Database 10g Express Edition - Free Download. 2. Using the Tool 2.1. Database Explorer The Database Explorer is the Datasource View provided by the DTP. It is used to create Database connections and to navigate the database. 2.1.1. Connecting to an Oracle Database You can create a connection to a database using the Data Source Explorer view. To open the Database Developmentperspective,click Windows > Open Perspective > Other from the Main menu, and then select Database Development from the Open Perspective dialog.This perspective opens the Data Source Explorer (DSE) view.
  • 15. Figure 1. Opening Database Perspective Rightclick on the Databases node in DSE and select New... to create a database connection,as Figure 2 shows. Figure 2. New Database Connection This displays the New Connection Profile wizard, as Figure 3 shows.
  • 16. Figure 3. New Connection Profile Dialog Select Oracle Database Connection from the list,and then click Next. If "Oracle Database Connection"is notlisted, restartEclipse with -clean command option.Provide a name for the connection and proceed to the next step. Complete the restof the dialog as follows:  Select Oracle Database 10g Driver Default from the drop-down listofdrivers.
  • 17.  Click Edit Driver Definition triangular button on the right, selectthe Jar List tab, then selectthe existing entry, and click Edit JAR/Zip. Browse to your eclipse directory, open the plugins folder, and select the oracle.eclipse.tools.database.jdbc.driver*.jar file. Note that you need to do this only once.  If the defaults are not appropriate for your configuration,change the following information in the URL field: o replace localhost with the hostname or IP address ofthe Oracle Database server. o replace 1521 with the port number of the Oracle Database Listener service. o replace xe with the Service Name (or SID) of the Database Service.  Provide the database user name and password for the connection.  Use the following optional properties ifrequired: 1. autocommit=false By default, autocommitis setto true, which results in immediate commitofthe operations from SQL Editor. When setto false, you need to execute the explicit COMMIT to committhe changes. See Oracle Database SQL Reference for more information. 2. sysdba=true Use this property to login with SYSDBA account. 3. sysoper=true Use this property to login with SYSOPER account.  Click Test Connection to test the connectivity.  Select Connect when the wizard completes checkbox to enable the database connection.  Select Finish to complete the wizard.
  • 18. Figure 4. Database Connection Details 2.1.2. Exploring the Oracle Database The open database connection allows you to navigate through the database objects.
  • 19. Figure 5. Exploring the Database
  • 20. Getting Started With the Oracle Database Plugin for Eclipse 1. Introduction 2. Using the Tool 1. Database Explorer 1. Connecting to an Oracle Database 2. Exploring an Oracle Database 3. Editing Data from a Table 4. Loading Data into a Table 5. Extracting Data from a Table 6. Generating DDL 2. SQL Tools 1. Using SQL Editor 2. Executing a Stored Procedure or Function 3. Executing Explain Plan 3. Additional Features 1. Granting Privileges 2. Creating Tables 3. Known Issues 4. Related Information 1. Introduction Welcome to the firststep towards supporting the Eclipse Data Tool Platform (DTP) by Oracle. This document provides a high-level tour through each of the Oracle Database Plugin features. Note that screen shots and examples in this document use the HR schema that is installed by default with Oracle Database. You may use Oracle Database 11g Release 1, or download Oracle Database 10g Express Edition - Free Download. 2. Using the Tool 2.1. Database Explorer The Database Explorer is the Datasource View provided by the DTP. You use it to create Database connections and to navigate the database. 2.1.1. Connecting to an Oracle Database You can create a connection to a database using the Data Source Explorer view, as follows: 1. To open the Database Developmentperspective,click Windows > Open Perspective > Other from the Main menu,and then select Database Development from the Open Perspective dialog.This perspective opens the Data Source Explorer (DSE) view.
  • 21. Figure 1. Opening Database Perspective 2. Rightclick on the Databases node in DSE and select New... to create a database connection,as Figure 2 shows. Figure 2. New Database Connection This displays the New Connection Profile wizard, as Figure 3 shows.
  • 22. Figure 3. New Connection Profile Dialog 3. Select Oracle Database Connection from the listand provide a name for the connection.Click Next to proceed to the next step. 4. Complete the restof the dialog as follows: o Select either Oracle Database 10g Driver Default or Oracle Database 11g Driver Default from the drop-down listofdrivers, as Figure 4 shows. o If the defaultsettings are not appropriate for your configuration,change the following information on the Properties > General tab of the New Connection Profile dialog:  In the SID field,replace xe with the Service Name (or SID) of the Database Service.  In the Host field, replace server with the hostname or IP address ofthe Oracle Database server (possiblylocalhost).  In the Port number field, replace 1521 with the port number of the Oracle Database Listener service.  Provide the database user name and password for the connection. Note that the Connection URL field reflects your changes.  Select a use group in the Catalog field. o On the Properties > Optional tab, setthe following optional properties,ifrequired:  autocommit=false By default, autocommitis setto true, which results in immediate commitofthe operations from SQL Editor. When setto false, you need to execute the explicit COMMIT to committhe changes.See Oracle Database SQL Reference for more information.  sysdba=true Use this property to login with SYSDBA account.
  • 23.  sysoper=true Use this property to login with SYSOPER account. o Click Test Connection to test the connectivity. If this fails,try restarting Eclipse with - clean command option. o Select Connect when the wizard completes checkbox to enable the database connection. o Select Finish to complete the wizard. Figure 4. Database Connection Details 2.1.2. Exploring the Oracle Database The open database connection allows you to navigate through the database objects.
  • 24. Figure 5. Exploring the Database 2.1.3. Editing Data from a Table
  • 25. With the enabled database connection,you can edit the table data in the Data Source Explorer (DSE). Note that, for comprehensive editing capabilities,itis recommended thatyou install Data Tools Platform SQL DevelopmentTools Data Functions feature,as follows:  If your machine is located inside ofa network,which requires a proxy to access outside resource such as the Internet, the configuration (download) mayfail due to the fact that Eclipse IDE includes a Web browser to let you access the Internet from within the IDE. In this case,reconfigure your Eclipse IDE proxy settings using Window > Preferences > General > Network Connections.  Select Help > Software Updates from the main menu.  Open the Available Software tab on the Software Updates and Add-ons dialog.  Click Add Site to install the feature provided by OEPE from OEPE's update site.To do so, enter http://www.oracle.com/technology/software/products/oepe/oepe_12g.htm l in the Location field of the Add Site dialog,and then click OK.  Expand the Ganymede Update Site node, and then expand the Database Development node.Select Data Tools Platform SQL Development Tools Data Functions, and then click Install. To edit a table data, navigate to the table you wantto editin the DSE, then right-click the table, and select Data > Edit, as Figure 6 shows.
  • 26. Figure 6. Editing Database Table This opens the table data in the editor, as Figure 7 shows.You can make changes to the table data by right-clicking on a table cell and using the popup menu.When you have finished editing,click Save to save the changes to the database.
  • 27. Figure 7. Database Table Editor 2.1.4. Loading Data into a Table To load data into a table from a text file, in the DSE, navigate to the table into which you want to load data. Right-click the table, and select Data > Load from the drop-down menu,as Figure 8 show.
  • 28. Figure 8. Loading Data This opens the Load Data dialog,as Figure 9 shows.Complete fields on the dialog,and then click Finish. Figure 9. Load Data Dialog
  • 29. Note that this may fail if there is a foreign key violation. 2.1.5. Extracting Data from a Table To extract data from a table to a text file, in the DSE, navigate to the table from which you want to extract data. Right- click the table and select Data > Extract from the drop-down menu,as Figure 10 shows. Figure 10. Extracting Data This opens the Extract Data dialog,as Figure 11 shows.Complete fields on the dialog,and then click Finish.
  • 30. Figure 11. Extract Data Dialog 2.1.6. Generating DDL You can use the Generate DDL option on mostdatabase objects to create or drop the object. In the DSE, navigate to the objectyou want to create or drop,right-click the object, and select Generate DDL from the drop-down menu to create a DDL script,as Figure 12 and Figure 13 show. Note that you need to create a projectin order to save the generated DDL script.See Creating a project for more details.
  • 32. Figure 13. Generating DDL The preceding steps generate the following statements: CREATE VIEW EMP_DETAILS_VIEW (EMPLOYEE_ID, JOB_ID, MANAGER_ID, DEPARTMENT_ID, LOCATION_ID, COUNTRY_ID, FIRST_NAME, LAST_NAME, SALARY, COMMISSION_PCT, DEPARTMENT_NAME, JOB_TITLE, CITY, STATE_PROVINCE, COUNTRY_NAME, REGION_NAME) AS SELECT e.employee_id, e.job_id,
  • 33. e.manager_id, e.department_id, d.location_id, l.country_id, e.first_name, e.last_name, e.salary, e.commission_pct, d.department_name, j.job_title, l.city, l.state_province, c.country_name, r.region_name FROM employees e, departments d, jobs j, locations l, countries c, regions r WHERE e.department_id = d.department_id AND d.location_id = l.location_id AND l.country_id = c.country_id AND c.region_id = r.region_id AND j.job_id = e.job_id WITH READ ONLY; 2.2. SQL Tools SQL Tools enable you to edit and run stored procedures and functions,as well as execute the so-called explain plans in either graphic or text mode. 2.2.1. Using SQL Editor To use an SQL Editor, do the following:  In the DSE, navigate to the procedure or function you want to edit.  Right-click the procedure or function and select Edit from the drop-down menu,as Figure 14 shows.
  • 34. Figure 14. Editing Stored Procedure The procedure or function opens in the SQL Editor, as Figure 15 shows.
  • 35. Figure 15. SQL Editor The SQL Editor enables standard text-based editing ofSQL statements,provides syntaxcolor, and multiple statementsupport. 2.2.2. Executing a Stored Procedure or Function To execute a stored procedure or function, do the following:  In the DSE, navigate to the procedure or function you want to run.  Right-click the procedure or function and select Run from the drop-down menu. If the procedure or function has any input parameters,the Configure Parameters dialog appears,as Figure 16 shows.Enter inputvalues and click OK to run the procedure or function.
  • 36. Figure 16. Configure Parameters Dialog 2.2.3. Executing Explain Plans To execute the explain plan, do the following:  In the Navigator or DSE, navigate to the scriptcontaining the SQL statementfor which you want to execute an explain plan.  Highlightthe script.  Right-click on the selection and selecteither Execute Text Explain Plan or Execute Graphic Explain Plan from the drop-down menu,as Figure 17 shows.
  • 37. Figure 17. Executiong Explain Plan For example,open the views.sql file that you created in the Generating DDL section.Highlight the SELECT statementblock,as shown in Figure 19. Right-click and select Execute Graphic Explain Plan from the drop-down menu.This opens the execution plan in graphic mode in the Execution Plan view, as Figure 18 shows.
  • 38. Figure 18. Execution Plan - Graphical Mode Alternatively, if you select Execute Text Explain Plan from the drop-down menu,itwill resultin a text version of the execution plan,as Figure 19 demonstrates.
  • 39. Figure 19. Execution Plan - Text Mode 2.3 Additional Features There is a number ofother features that you can explore using the tool. 2.3.1 Granting Privileges To grant specific database privileges to a specific user,do the following:  In the DSE, navigate to the element(such as a table,for example) for which you want the user to have certain privileges.  Right-click the elementand select Grant Privileges from the drop-down menu,as Figure 20 shows.
  • 40. Figure 20. Granting Privileges This will open the Grant Privileges dialog,as Figure 21 shows.
  • 41. Figure 21. Grant Privileges Dialog Select one of the privileges from the listand click OK. To revoke specific database privileges from a specific user,do the following:  In the DSE, navigate to the element(such as a table,for example) for which you want to revoke the user privileges.  Right-click the elementand select Revoke Privileges from the drop-down menu. This will open the Revoke Privileges dialog,as Figure 22 shows.
  • 42. Figure 22. Revoke Privileges Dialog Select one of the privileges from the listand click OK. 2.3.2 Creating Tables Using the tool, you can create new database tables bydeclaring new columns,defining primary,unique,and foreign keys, as well as adding checked constraints and indices. To create a new database table,follow this procedure:  In the DSE, navigate to the Tables element.  Right-click the elementand select New Table from the drop-down menu,as Figure 23 shows.
  • 43. Figure 23. Creating a New Table This opens the Create Table dialog that Figure 24 shows.
  • 44. Figure 24. Create Table Dialog Even though by defaultthe table is created using the schema ofthe user who established the connection, you can change the database schema.If the user who established the connection does nothave privileges to create a new table in another schema,the SQL Result view will displayan error message after the wizard completes.  Using the Create Table dialog,specify the following: o The name for your table. o One or more table columns:to define a column,click Add, and then provide the column's name, selectthe type using the Type dialog (see Figure 25), and specify whether or not the value can be null.
  • 45. Figure 25. Type Dialog For each column,you can set data type as either a predefined SQL type, or a user-defined type. Depending on the column type, the Details portion of the dialog (see Figure 26) displays different settings.For example,for the NUMBER type, Details portion lets you specify the defaultvalue, precision and scale;for VARCHAR2 type, you can specify the defaultvalue and size.
  • 46. Figure 26. Completed Create Table Dialog  You can reorder the table columns using the Move Up and Move Down buttons.  Click Next on the Create Table dialog to open the Create Table > Primary Key dialog.On this dialog, select Add primary key, and then define the name and selectone or more columns thatmake up the primarykey, as Figure 27 shows.Ifa column type is not suitable as a primarykey column,a validation error will be displayed.Proceed by clicking Next.
  • 47. Figure 27. Primary Key Dialog  On the next Create Table > Unique Constraints dialog that Figure 28 shows,define unique constraints for the table by clicking Add. When defined,click Next to proceed.
  • 48. Figure 28. Unique Constraints Dialog There are three types of validation for the unique constraints: o Each column mustbe suitable for unique constraints.For example,a column of type CLOB is not suitable as a column in unique constraints. o A unique constraintmustnotcontain the same columns as the primarykey. o A unique constraintmustnot contain the same columns as another unique constraint.  On the next Create Table > Foreign Keys dialog that Figure 29 shows,define foreign keys for the table by clicking Add. Note that foreign keys can reference the primarykey of a table which resides in another schema.You can
  • 49. switch schemas byclicking Browse for the Referenced schema field.By clicking Browse for the Referenced table field you can switch to different tables in the referenced schema.When the referenced table is selected,the wizard will look up its primarykey and fill the Referenced constraint field if the primarykey exist. It will also try to match the columns in the referenced table with columns in the new table based on their types. Matched columns will show in the Associations table.If there are multiple columns thatmatch a column in the referenced table, the wizard will choose the firstone it finds,which you can change. When finished,click Next. Figure 29. Foreign Keys Dialog  Using the next Create Table > Check Constraints dialog that Figure 30 shows,add checked constraints for the new table by clicking Add.
  • 50. Note that the Condition field is represented bya free-formatted text area.When using it, you have to ensure that the text for the checked constraints conforms to PL/SQL syntax. Otherwise,you will not be able to set the condition successfully. When finished,click Next. Figure 30. Check Constraints Dialog  Use the next Create Table > Indices dialog that Figure 31 shows to add create indices for the new table by clicking Add, and then click Next.
  • 51. Figure 31. Indices Dialog  The next Create Table > DDL dialog that Figure 32 shows summarizes the DDL used to create the new table. You can make changes to the DDL before it is executed. Note that if you do make changes to the DDL, and then go back to previous dialogs and decide to add a new column,then your changes to the DDL will be lostand a new DDL will be generated.. Click Finish to complete the wizard.
  • 52. Figure 31. DDL Dialog Upon completion,the table creation DDL is sentto the JDBC driver and executed there. If the execution is successful,a new table with all the specified constraints will be created.You can examine the resultof new table creation from the SQL Result view that opens (see Figure 32).
  • 53. Figure 32. SQL ResultView Note that the table creation DDL is not executed as a single SQL statement.For any constraint,an ALTER TABLE... statementis executed. If any of the ALTER TABLE statements fails,you have the option on whether or not to continue to execute subsequentstatements. If the newly created table is not displayed in the Tables node in Data Source Explorer, you will need to refresh the view. 3. Known Issues  Unable to sortfolders - this issue results in an inabilityto sortthe nodes on Data Source Explorer (DSE) in an order that is consistentwith how it is displayed in Oracle SQL Developer. 4. Related Information
  • 54.  Eclipse Data Tools Project  Oracle Database 11g Release 1 Documentation  Oracle Database 10g Express Edition Tutorial  Oracle Database 10g Express Edition  Eclipse Callisto ProjectProfile:Data Tools Platform Copyright © 2008, 2011, Oracle. All rights reserved. Eclipse Callisto Project Profile: Data Tools Platform Nearly all J2EE applications use a relational database of some kind. Eclipse provides an integrated set of tools for working with such databases in the Callisto Data Tools Platform. by John Ferguson Smart 0 Google +0 0 Oct 16, 2006 Page 1 of 3
  • 55. elational databases are a constant in today's development world. Despite advances in alternative storage and indexing technologies, such as full-text searching and indexing with Lucene and object-oriented and XML databases, the vast majority of modern J2EE applications still work with at least one relational database in one form or another. Yet this aspect of Java development has long been neglected in the standard Eclipse tool set, and developers have had to look for third-party plug-ins or external tools for their database needs. Eclipse 3.2 has changed all that. The Data Tools Platform (DTP), and to a lesser extent the Web Tools Platform (WTP), both part of the new Callisto product suite released with Eclipse 3.2, provide a range of data-centric tools, including JDBC connectivity, SQL querying, database browsing, and more. DTP provides a comprehensive set of tools for data-centric development, including SQL querying (including a visual SQL query modeler), execution plan analysis, and script history tracing. It also includes a framework for editing and debugging queries and stored procedures, and it enables you to connect to data sources other than relational ones. However, this promising project is still very much under development; only a subset of these features is currently available. Currently in its 0.91 release, the version 1.0 of DTP is scheduled for release in December 2006. While the DTP project is devoted exclusively to data-centric development, the WTP project contains mostly tools and editors for J2EE development. But some WTP tools concern database development as well. This article looks at the tools provided by both these projects to make life easier when you work with relational databases in a J2EE application. Installing DTP and WTP Although these tools are part of the Callisto package, they do not come with the standard Eclipse 3.2 installation out of the box. However, they are relatively straightforward to install. The simplest approach is to use the remote update site, which is pre-configured in Eclipse 3.2. Go to the Remote Update window ("Help -> Software Updates -> Find and Install"), and select the "Callisto Discovery Site". Eclipse will propose the full range of Callisto plug-ins and updates (see Figure 1). You will need to select at least the following plug-ins, plus any others you may be interested in:  Database development  Enabling features  Graphical editors and frameworks  Models and model development  Web and J2EE development Alternatively, you can select all the Callisto tools, as they are all useful (with the possible exception, from a Java developer's point of view, of "C and C++ development").
  • 56. Figure 1. Installing DTP from the Remote Site Once you have installed the DTP tools, you need to restart your IDE. You are now ready to take a look at the main features of DTP and the database-oriented features of WTP. Some overlap currently exists between the two projects. The first part of the article investigates the DTP tools, and the second part examines WTP's database tools and how they compare to the ones in DTP. - See more at: http://www.devx.com/Java/Article/32829?pf=true#sthash.OTM9fMYB.dpuf Connecting to a Database Using DTP The first thing you need to do in DTP is set up a connection to your target database. Open the Preferences screen and choose "Connectivity -> Driver Definitions". DTP knows how to connect to a wide range of databases, including DB2, Derby, MySQL Oracle, and Sybase, as well as a generic JDBC connector. Suppose you want to connect to a MySQL database. Choose the MySQL 4.1 entry and click on "Add". This will open the "New Driver Entry" window (see Figure 2), in which you select a JDBC driver and provide a name for your connection (you can have several connections of the same type to different databases, identified by different names).
  • 57. Figure 2. Creating a New Database Connection Turning the Tide: Surviving (and Thriving in) the Software Developer Shortage Download Now Next, you fill in the details for this particular connection. If this is the first time you've added a connection using this JDBC driver, you have to provide the path to the driver's jar file. And, not unreasonably, you also need to provide the usual JDBC connection details, such as the connection URL, user ID, and password (see Figure 3). Once this is done, your connection is ready for use! Figure 3. Provide the Usual JDBC Connection Details
  • 58. The Database DevelopmentPerspective The DTP project provides a new perspective tailored for data-centric development: the Database Development perspective. Open this perspective ("Window -> Open Perspective -> Other -> Database Development"). One of its principal views is the Data Source Explorer, which lets you browse database structures using a feature called a Connection Profile. Think of a Connection Profile as an instance of the database connection you created previously. As you will see, you can either use a preexisting database connection as the basis for a Connection Profile or create a new one entirely from scratch. To create a new Connection Profile to the database you just set up, go to the "Databases" node in the Data Source Explorer and choose "New..." in the contextual menu. This will open the "New Connection Profile" screen, which proposes a choice between a connection to an embedded Derby database ("Derby - Embedded Data") or a more general connection to a traditional JDBC database ("SQL Model – JDBC Connection"). Choose the latter. You will be prompted to provide a name for your profile, and then to enter the connection configuration details (see Figure 4). Figure 4. Configuring the New Database Connection Profile Here, you select one of the drivers configured in the Driver Definition screen as the basis for your connection. You can also supply supplementary properties to the JDBC driver and test the connection. When you're done, the new connection profile will appear in the Data Source Explorer. From here, you can (as the name indicates) explore the structure of the database, which is represented in an intuitive tree-view structure (see Figure 5).
  • 59. Figure 5. Exploring a Database Structure This view provides a comprehensive look at the database structure: tables, columns, stored procedures, indexes, triggers, and so on. However, it is strictly read-only—no modification allowed. You can't query the database from this view either (you will see how to query the database further on). The only exception is you can run stored procedures from within this view. If your database has stored procedures, they will be listed under the entry of the same name. To run a stored procedure, simply select it and choose "Run..." in the contextual menu. DTP Data Sources are not limited to relational databases. The ODA (Open Data Access) Data Sources also provide access to data from other sources, such as CSV and XML files, or even custom data sources. - See more at: http://www.devx.com/Java/Article/32829/0/page/2#sthash.jhJw08pA.dpuf Querying the Database Being able to see the structure of the database is all well and good, but it is often useful to be able to see inside the database as well. You may simply need to list the contents of a table, or you may want to test and analyze the performance of complex SQL queries. The Callisto tools cater well to these needs as well. The basic tool for SQL querying in DTP is the SQL File editor, which provides syntax coloring and limited auto-completion functionalities. Create a new SQL File (New -> Other... -> SQL Development -> SQL File), and enter a query. When you have finished writing your query, use the "Set Connection Info" to associate the SQL File with a given Database Connection Profile. Choose the "Generic JDBC" connection profile type, and then select your connection profile and database names from the drop-down lists. Now your query is ready to run. You can either use "Execute All" to run the entire script, or select just one SQL statement and run "Execute Selected Text". This feature can be quite useful for debugging SQL scripts.
  • 60. Turning the Tide: Surviving (and Thriving in) the Software Developer Shortage Download Now Results are displayed in the "SQL Results" view (see Figure 6). Eclipse keeps a list of the queries you've executed, along with their results, which is convenient for future reference. Results are displayed in a convenient tabular form and can be sorted by each column. Figure 6. A DTP Query Another neat feature is the ability to export query results in a variety of formats: just select "Save" (to export data to a file within your project) or "Export" (to export data anywhere else) in the contextual menu in the results table. Many other interesting tools are planned for the DTP project, including a visual SQL editor and an Execution Plan analysis view. Although this project is still fairly recent, its scope is definitely ambitious. It seems to promise great things. Using the WTP Tools for Database Development The Data Tools Platform is not the only Callisto project to provide database support. The Web Tools Platform project also provides some interesting querying tools, which are definitely worth a look. Unfortunately, in the current release, the database connections you configured earlier on for the Data Source Explorer are not visible to the WTP tools, so you have to reconfigure a new WTP-friendly connection. You do this in the "Database Explorer" view: use "New..." in the contextual menu to create a new connection (see Figure 7). Entering a new connection is not the easiest of tasks. You need to provide all the details (database, JDBC driver, connection URL, and so on) with little prompting or assistance.
  • 61. Figure 7. Setting Up a WTP JDBC Connection If creating a new WTP-style connection is a little less user-friendly than in DTP, the results in the Database Explorer view (see Figure 8) makes it worth it. This view presents the database structure in a hierarchical format like the Data Source Explorer, but with many more possibilities than the DTP equivalent. Figure 8. The Database Explorer View In addition to browsing through the structure of the database, you can actively query the contents. By simply right-clicking on a table or column, you can display a subset of the table data using the "Data -> Sample Contents" entry. If you have sufficient rights, you can modify the database structure by dropping
  • 62. columns or even entire tables. You can also display the SQL used to create the table, export or import data, or even edit the contents of the table (using "Data -> Edit"). WTP also provides an alternative way to run ad-hoc SQL queries: the SQL Scrapbook. Create a new SQL Scrapbook ("File -> New -> Other -> Data -> SQL Scrapbook Page") and enter a SQL query. The SQL Scrapbook provides SQL syntax coloring, but does not support auto-completion. You can associate a connection using the contextual menu ("Use Database Connection"). Run the query with "Run SQL". Query results appear in the "Data Output" view. Although similar to the DTP SQL Page, the WTP SQL Scrapbook feature is somewhat less sophisticated. Results cannot be sorted, for example, nor can you execute a selected query within the scrapbook. DTP Tools Ambitious in Scope Eclipse 3.2 and Callisto offer a number of powerful tools for database-oriented development activities with the WTP and DTP toolsets. The two projects overlap considerably, but the WTP tools are mature and feature rich while the DTP tools are more ambitious in scope. So WTP probably will meet the needs of many of today's Java developers, and DTP will become the reference tool set for database development under Eclipse. However, both objectively are still quite young, with many enticing features promised for future versions. Nevertheless, in areas such as ad-hoc querying, the DTP functionality already out-does its WTP equivalent. All in all, if you need to work with relational databases in your Java application development project, both of these tool sets are definitely worth a look. - See more at: http://www.devx.com/Java/Article/32829/0/page/3#sthash.dwCgmUkA.dpuf Getting Started With the Oracle Database Plugin for Eclipse 1. Introduction 2. Using the Tool 1. Database Explorer 1. Connecting to an Oracle Database 2. Exploring an Oracle Database 3. Editing Data from a Table 4. Loading Data into a Table 5. Extracting Data from a Table 6. Generating DDL 2. SQL Tools 1. Using SQL Editor 2. Executing a Stored Procedure or Function 3. Executing Explain Plan 3. Additional Features 1. Granting Privileges 2. Creating Tables 3. Known Issues 4. Related Information 1. Introduction
  • 63. Welcome to the firststep towards supporting the Eclipse Data Tool Platform (DTP) by Oracle. This document provides a high-level tour through each of the Oracle Database Plugin features. Note that screen shots and examples in this document use the HR schema that is installed by default with Oracle Database. You may use Oracle Database 11g Release 1, or download Oracle Database 10g Express Edition - Free Download. 2. Using the Tool 2.1. Database Explorer The Database Explorer is the Datasource View provided by the DTP. You use it to create Database connections and to navigate the database. 2.1.1. Connecting to an Oracle Database You can create a connection to a database using the Data Source Explorer view, as follows: 1. To open the Database Developmentperspective,click Windows > Open Perspective > Other from the Main menu,and then select Database Development from the Open Perspective dialog.This perspective opens the Data Source Explorer (DSE) view. Figure 1. Opening Database Perspective 2. Rightclick on the Databases node in DSE and select New... to create a database connection,as Figure 2 shows.
  • 64. Figure 2. New Database Connection This displays the New Connection Profile wizard, as Figure 3 shows.
  • 65. Figure 3. New Connection Profile Dialog 3. Select Oracle Database Connection from the listand provide a name for the connection.Click Next to proceed to the next step. 4. Complete the restof the dialog as follows: o Select either Oracle Database 10g Driver Default or Oracle Database 11g Driver Default from the drop-down listofdrivers, as Figure 4 shows. o If the defaultsettings are not appropriate for your configuration,change the following information on the Properties > General tab of the New Connection Profile dialog:  In the SID field,replace xe with the Service Name (or SID) of the Database Service.  In the Host field, replace server with the hostname or IP address ofthe Oracle Database server (possiblylocalhost).  In the Port number field, replace 1521 with the port number of the Oracle Database Listener service.  Provide the database user name and password for the connection. Note that the Connection URL field reflects your changes.  Select a use group in the Catalog field. o On the Properties > Optional tab, setthe following optional properties,ifrequired:  autocommit=false By default, autocommitis setto true, which results in immediate commitofthe operations from SQL Editor. When setto false, you need to execute the explicit COMMIT to committhe changes.See Oracle Database SQL Reference for more information.  sysdba=true Use this property to login with SYSDBA account.  sysoper=true Use this property to login with SYSOPER account. o Click Test Connection to test the connectivity. If this fails,try restarting Eclipse with - clean command option. o Select Connect when the wizard completes checkbox to enable the database connection. o Select Finish to complete the wizard.
  • 66. Figure 4. Database Connection Details 2.1.2. Exploring the Oracle Database The open database connection allows you to navigate through the database objects.
  • 67. Figure 5. Exploring the Database 2.1.3. Editing Data from a Table With the enabled database connection,you can edit the table data in the Data Source Explorer (DSE).
  • 68. Note that, for comprehensive editing capabilities,itis recommended thatyou install Data Tools Platform SQL DevelopmentTools Data Functions feature,as follows:  If your machine is located inside ofa network,which requires a proxy to access outside resource such as the Internet, the configuration (download) mayfail due to the fact that Eclipse IDE includes a Web browser to let you access the Internet from within the IDE. In this case,reconfigure your Eclipse IDE proxy settings using Window > Preferences > General > Network Connections.  Select Help > Software Updates from the main menu.  Open the Available Software tab on the Software Updates and Add-ons dialog.  Click Add Site to install the feature provided by OEPE from OEPE's update site.To do so, enter http://www.oracle.com/technology/software/products/oepe/oepe_12g.htm l in the Location field of the Add Site dialog,and then click OK.  Expand the Ganymede Update Site node, and then expand the Database Development node.Select Data Tools Platform SQL Development Tools Data Functions, and then click Install. To edit a table data, navigate to the table you wantto editin the DSE, then right-click the table, and select Data > Edit, as Figure 6 shows.
  • 69. Figure 6. Editing Database Table This opens the table data in the editor, as Figure 7 shows.You can make changes to the table data by right-clicking on a table cell and using the popup menu.When you have finished editing,click Save to save the changes to the database.
  • 70. Figure 7. Database Table Editor 2.1.4. Loading Data into a Table To load data into a table from a text file, in the DSE, navigate to the table into which you want to load data. Right-click the table, and select Data > Load from the drop-down menu,as Figure 8 show.
  • 71. Figure 8. Loading Data This opens the Load Data dialog,as Figure 9 shows.Complete fields on the dialog,and then click Finish. Figure 9. Load Data Dialog
  • 72. Note that this may fail if there is a foreign key violation. 2.1.5. Extracting Data from a Table To extract data from a table to a text file, in the DSE, navigate to the table from which you want to extract data. Right- click the table and select Data > Extract from the drop-down menu,as Figure 10 shows. Figure 10. Extracting Data This opens the Extract Data dialog,as Figure 11 shows.Complete fields on the dialog,and then click Finish.
  • 73. Figure 11. Extract Data Dialog 2.1.6. Generating DDL You can use the Generate DDL option on mostdatabase objects to create or drop the object. In the DSE, navigate to the objectyou want to create or drop,right-click the object, and select Generate DDL from the drop-down menu to create a DDL script,as Figure 12 and Figure 13 show. Note that you need to create a projectin order to save the generated DDL script.See Creating a project for more details.
  • 75. Figure 13. Generating DDL The preceding steps generate the following statements: CREATE VIEW EMP_DETAILS_VIEW (EMPLOYEE_ID, JOB_ID, MANAGER_ID, DEPARTMENT_ID, LOCATION_ID, COUNTRY_ID, FIRST_NAME, LAST_NAME, SALARY, COMMISSION_PCT, DEPARTMENT_NAME, JOB_TITLE, CITY, STATE_PROVINCE, COUNTRY_NAME, REGION_NAME) AS SELECT e.employee_id, e.job_id,
  • 76. e.manager_id, e.department_id, d.location_id, l.country_id, e.first_name, e.last_name, e.salary, e.commission_pct, d.department_name, j.job_title, l.city, l.state_province, c.country_name, r.region_name FROM employees e, departments d, jobs j, locations l, countries c, regions r WHERE e.department_id = d.department_id AND d.location_id = l.location_id AND l.country_id = c.country_id AND c.region_id = r.region_id AND j.job_id = e.job_id WITH READ ONLY; 2.2. SQL Tools SQL Tools enable you to edit and run stored procedures and functions,as well as execute the so-called explain plans in either graphic or text mode. 2.2.1. Using SQL Editor To use an SQL Editor, do the following:  In the DSE, navigate to the procedure or function you want to edit.  Right-click the procedure or function and select Edit from the drop-down menu,as Figure 14 shows.
  • 77. Figure 14. Editing Stored Procedure The procedure or function opens in the SQL Editor, as Figure 15 shows.
  • 78. Figure 15. SQL Editor The SQL Editor enables standard text-based editing ofSQL statements,provides syntaxcolor, and multiple statementsupport. 2.2.2. Executing a Stored Procedure or Function To execute a stored procedure or function, do the following:  In the DSE, navigate to the procedure or function you want to run.  Right-click the procedure or function and select Run from the drop-down menu. If the procedure or function has any input parameters,the Configure Parameters dialog appears,as Figure 16 shows.Enter inputvalues and click OK to run the procedure or function.
  • 79. Figure 16. Configure Parameters Dialog 2.2.3. Executing Explain Plans To execute the explain plan, do the following:  In the Navigator or DSE, navigate to the scriptcontaining the SQL statementfor which you want to execute an explain plan.  Highlightthe script.  Right-click on the selection and selecteither Execute Text Explain Plan or Execute Graphic Explain Plan from the drop-down menu,as Figure 17 shows.
  • 80. Figure 17. Executiong Explain Plan For example,open the views.sql file that you created in the Generating DDL section.Highlight the SELECT statementblock,as shown in Figure 19. Right-click and select Execute Graphic Explain Plan from the drop-down menu.This opens the execution plan in graphic mode in the Execution Plan view, as Figure 18 shows.
  • 81. Figure 18. Execution Plan - Graphical Mode Alternatively, if you select Execute Text Explain Plan from the drop-down menu,itwill resultin a text version of the execution plan,as Figure 19 demonstrates.
  • 82. Figure 19. Execution Plan - Text Mode 2.3 Additional Features There is a number ofother features that you can explore using the tool. 2.3.1 Granting Privileges To grant specific database privileges to a specific user,do the following:  In the DSE, navigate to the element(such as a table,for example) for which you want the user to have certain privileges.  Right-click the elementand select Grant Privileges from the drop-down menu,as Figure 20 shows.
  • 83. Figure 20. Granting Privileges This will open the Grant Privileges dialog,as Figure 21 shows.
  • 84. Figure 21. Grant Privileges Dialog Select one of the privileges from the listand click OK. To revoke specific database privileges from a specific user,do the following:  In the DSE, navigate to the element(such as a table,for example) for which you want to revoke the user privileges.  Right-click the elementand select Revoke Privileges from the drop-down menu. This will open the Revoke Privileges dialog,as Figure 22 shows.
  • 85. Figure 22. Revoke Privileges Dialog Select one of the privileges from the listand click OK. 2.3.2 Creating Tables Using the tool, you can create new database tables bydeclaring new columns,defining primary,unique,and foreign keys, as well as adding checked constraints and indices. To create a new database table,follow this procedure:  In the DSE, navigate to the Tables element.  Right-click the elementand select New Table from the drop-down menu,as Figure 23 shows.
  • 86. Figure 23. Creating a New Table This opens the Create Table dialog that Figure 24 shows.
  • 87. Figure 24. Create Table Dialog Even though by defaultthe table is created using the schema ofthe user who established the connection, you can change the database schema.If the user who established the connection does nothave privileges to create a new table in another schema,the SQL Result view will displayan error message after the wizard completes.  Using the Create Table dialog,specify the following: o The name for your table. o One or more table columns:to define a column,click Add, and then provide the column's name, selectthe type using the Type dialog (see Figure 25), and specify whether or not the value can be null.
  • 88. Figure 25. Type Dialog For each column,you can set data type as either a predefined SQL type, or a user-defined type. Depending on the column type, the Details portion of the dialog (see Figure 26) displays different settings.For example,for the NUMBER type, Details portion lets you specify the defaultvalue, precision and scale;for VARCHAR2 type, you can specify the defaultvalue and size.
  • 89. Figure 26. Completed Create Table Dialog  You can reorder the table columns using the Move Up and Move Down buttons.  Click Next on the Create Table dialog to open the Create Table > Primary Key dialog.On this dialog, select Add primary key, and then define the name and selectone or more columns thatmake up the primarykey, as Figure 27 shows.Ifa column type is not suitable as a primarykey column,a validation error will be displayed.Proceed by clicking Next.
  • 90. Figure 27. Primary Key Dialog  On the next Create Table > Unique Constraints dialog that Figure 28 shows,define unique constraints for the table by clicking Add. When defined,click Next to proceed.
  • 91. Figure 28. Unique Constraints Dialog There are three types of validation for the unique constraints: o Each column mustbe suitable for unique constraints.For example,a column of type CLOB is not suitable as a column in unique constraints. o A unique constraintmustnotcontain the same columns as the primarykey. o A unique constraintmustnot contain the same columns as another unique constraint.  On the next Create Table > Foreign Keys dialog that Figure 29 shows,define foreign keys for the table by clicking Add. Note that foreign keys can reference the primarykey of a table which resides in another schema.You can
  • 92. switch schemas byclicking Browse for the Referenced schema field.By clicking Browse for the Referenced table field you can switch to different tables in the referenced schema.When the referenced table is selected,the wizard will look up its primarykey and fill the Referenced constraint field if the primarykey exist. It will also try to match the columns in the referenced table with columns in the new table based on their types. Matched columns will show in the Associations table.If there are multiple columns thatmatch a column in the referenced table, the wizard will choose the firstone it finds,which you can change. When finished,click Next. Figure 29. Foreign Keys Dialog  Using the next Create Table > Check Constraints dialog that Figure 30 shows,add checked constraints for the new table by clicking Add.
  • 93. Note that the Condition field is represented bya free-formatted text area.When using it, you have to ensure that the text for the checked constraints conforms to PL/SQL syntax. Otherwise,you will not be able to set the condition successfully. When finished,click Next. Figure 30. Check Constraints Dialog  Use the next Create Table > Indices dialog that Figure 31 shows to add create indices for the new table by clicking Add, and then click Next.
  • 94. Figure 31. Indices Dialog  The next Create Table > DDL dialog that Figure 32 shows summarizes the DDL used to create the new table. You can make changes to the DDL before it is executed. Note that if you do make changes to the DDL, and then go back to previous dialogs and decide to add a new column,then your changes to the DDL will be lostand a new DDL will be generated.. Click Finish to complete the wizard.
  • 95. Figure 31. DDL Dialog Upon completion,the table creation DDL is sentto the JDBC driver and executed there. If the execution is successful,a new table with all the specified constraints will be created.You can examine the resultof new table creation from the SQL Result view that opens (see Figure 32).
  • 96. Figure 32. SQL ResultView Note that the table creation DDL is not executed as a single SQL statement.For any constraint,an ALTER TABLE... statementis executed. If any of the ALTER TABLE statements fails,you have the option on whether or not to continue to execute subsequentstatements. If the newly created table is not displayed in the Tables node in Data Source Explorer, you will need to refresh the view. 3. Known Issues  Unable to sortfolders - this issue results in an inabilityto sortthe nodes on Data Source Explorer (DSE) in an order that is consistentwith how it is displayed in Oracle SQL Developer. 4. Related Information
  • 97.  Eclipse Data Tools Project  Oracle Database 11g Release 1 Documentation  Oracle Database 10g Express Edition Tutorial  Oracle Database 10g Express Edition  Eclipse Callisto ProjectProfile:Data Tools Platform Copyright © 2008, 2011, Oracle. All rights reserved.     
  • 98.   Database Development in Eclipse with the Data Tools Platform (DTP) Published February 11,2008 Filed under  Databases,  Eclipse I'm getting lazier. I mean lazy like looking for 10 minutes for a lost TV remote rather than getting off the couch to change the channel. Sure, it's not a big deal to switch back and forth between Eclipse and the MySQL Query Browser or phpMyAdmin, but those seconds add up. In this post I'll show you how to take advantage of another part of the "I" in the Eclipse "IDE". The Eclipse Data Tools Platform (DTP) is a standard Eclipse plugin that you can use to perform most database development and query functions. The DTP plugin supports several database platforms via JDBC, including Derby, Oracle, MS SQL, Postgres, Sybase ASA, Flat Files, XML Data, Web Services, and more. This post covers connecting to MySQL and basic DTP features. Requirements
  • 99. I'll assume that you're comfortable installing Eclipse and Eclipse plugins . I'm also assuming that you've used Eclipse for a bit and have at least one project defined. Here's what you'll need before we get started.  Eclipse with the DTP plugin, I'm running Eclipse 3.3 which came bundled with DTP version 1.5.0.  MySQL JDBC Driver, I'm using Connect/J 5.1.  MySQL Server version 4 or 5 running on localhost or a remote host that allows remote connections.  MySQL user account with a database or privileges to create databases. Install a JDBC Driver Installing Eclipse and DTP does not install JDBC drivers. You must install the appropriate driver for the database server you're using. You can usually get drivers from the vendor. I downloaded the MySQL Connector/J. 1. Visit http://dev.mysql.com/downloads/connector/ 2. Select 'Connector/J' in the left menu, then select a version. I used version 5.1. 3. Download the source and binaries and save somewhere that makes sense for your OS. I dropped mine in /Library/Java/Extensions on my Mac. Create a Driver Template and Connection Profile Next, create a driver template and a connection profile. You'll be able to reuse this template when creating future connection profiles. 1. Select File > New > Other 2. Expand Connection Profiles and select Connection Profile, Next >
  • 100. 3. Select Generic JDBC Connection, Next > 4. Name the Connection Profile for the host and database to which you're connecting (i.e. localhost.database), Next > 5. Click on the ... button to add your JDBC driver to the Select a driver dropdown menu. 1. Select the appropriate folder for your database JDBC driver version, I selected MySQL > 5.1, Click Add... 2. Expand the Available Driver Templates folders, select "MySQL JDBC Driver" 3. Add the driver version to the Driver Name, I changed mine to "MySQL JDBC Driver 5.1" Note: Don't be confused by differences in server and driver versions. You can use the 5.1 driver to connect to MySQL 4.x. 4. Check "Edit New Driver Definition Immediately", click OK 6. Eclipse will display an "Unable to locate jar/zip..." message. Tell Eclipse where the JDBC driver is. 1. Select the driver file in the list, click the "Edit Jar/Zip" button
  • 101. 2. Browse to and open your JDBC driver. I placed mine at /Library/Java/Extensions/mysql-connector-java-5.1.5/mysql-connector-java- 5.1.5-bin.jar 3. Set your Connection URL, Database Name, Password, and User ID in the Properties pane, click OK
  • 102. 7. Your Driver template now appears in the Available Driver Definitions list, select it, click OK 8. Add Optional Properties to those you just set or check the "Save Password" box if you'd like. 9. Click the "Test Connection" button, hopefully your Ping succeeded! If not, double check your connection properties. 10.Click Finish Open DTP's Database Development Perspective With a connection template and profile defined, open up the Database Development Perspective, if it isn't already open. 1. Select Window > Open Perspective > Other... 2. Select Database Development, click OK
  • 103. Establish a Database Connection 1. In the Data Source Explorer pane, expand the Database folder. 2. Right-click on the Connection Profile and select Connect 3. You should now see folders for table, stored procedures, views, and other objects supported by your database platform. 4. If you have tables in your database, expand to view columns. Create and Execute SQL Files
  • 104. You can create and modify tables, triggers, stored procedures directly via DTP. Before proceeding, open an existing or create a new Eclipse project. You'll save SQL files to an existing project which makes it easy to place them under version control with the rest of your application files. 1. Select File > New > SQL File (or File > New > Other > SQL Development > SQL File). 2. Choose the project and folder where you'll save the file. 3. Select the Database server type, Connection profile, and Database name. You can skip specifying the database if you're going to create one with the file. 4. Click Finish 5. Type in the SQL you'd like to run.
  • 105. 6. Select all, or a portion, of the SQL to run. 7. Right-click in the document tab and select either Execute All or Execute Selected Text. 8. Review the SQL Results at the bottom of the SQL Development Perspective. The buttons in the SQL Results tab allow you to track the status for all SQL executed and provide a handy filter for sifting through results. Insert and Edit Data
  • 106. 1. Expand Databases > Host > YourDatabase > Schemas in the Data Source Explorer 2. Right-click on a table and select Data > Edit 3. An editor tab appears with the table's columns, enter one or many records into the rows provided 4. Right-click anywhere in the editor panel and select save Easy, isn't it? You probably noticed other nifty features under the Data menu, including Load and Extract. These options allow you to import and export delimitied data from files. Conclusion Overall I'm very happy with DTP. It's been a bit of an adjustment getting used to how things are done, but I no longer have to get off the Eclipse "couch" to take care of SQL
  • 107. development tasks. I've covered most of the basics here but I think you'll find several other useful features. Happy data developing! Related Links  Using the Eclipse Data Tools Platform with PowerBuilder and SQL Anywhere  Getting Started with DTP from the Eclipse Wiki  EclipseCon 2007 DTP Related Sessions  Eclipse Data Tools Platform (DTP)  Previous article › Firefox 3 Can't Come Soon Enough  ‹ Next article