SlideShare a Scribd company logo
1 of 29
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   Exercise 7. Connect to a Database

          Estimated time
                                  01:00


          What this exercise is about
                                  In this exercise you will explore the Data perspective. You will
                                  manipulate database information, both by importing it into Rational
                                  Application Developer and by generating a new database and
                                  exporting it.


          What you should be able to do
                                  At the end of this lab, you will be able to:
                                   • Connect to a database and sample the data
                                   • Import the database structure into Rational Application Developer
                                   • Create and populate new database tables
                                   • Use the SQL Builder to create a SQL statement and query the
                                     library database
                                   • Create a diagram from the tables


          Introduction
                                  Developers are generally more concerned with examining existing
                                  database structures and sampling data, rather than creating new
                                  structures and writing them back to the database. Nevertheless, there
                                  are times when it is necessary to create a new database for test
                                  purposes, and IBM Rational Application Developer (V7 and later) has
                                  the tools to do this.
                                  This lab takes you through both processes: importing information (both
                                  structural and sample data), and exporting artifacts created in Rational
                                  Application Developer.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database        7-1
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



Requirements
                        This exercise requires one code fragment. Make sure that the file
                        appears in the <LAB_FILES> DataSnippets directory before
                        starting the lab.
                        It also requires that the Derby database (LIBRARY) exist. This should
                        have been set up in Lab 1. If it has not been set up, see Appendix A for
                        instructions on how to do this.


Instructor exercise overview
This exercise divides into four sections, of which the first and third are the most important
for developers:
1. Importing structure from a database, and sampling data.
There are several different ways to create the project to contain the database structure.
The one used in this lab is not necessarily the fastest, but it is expected that students will
discover other ways themselves when they need to use this process. Step 3b) has the key
screenshot, the dialog where the database type is chosen, the address entered and the
connection tested. You should have gone over this in the presentation. It would be good, if
there is time, to revisit this dialog after the lab before continuing with the next presentation.
2. Creating structure in Rational Application Developer and exporting it to a
database.
Students should understand that they would not usually have the permission to create
databases this way in the real world! This is strictly a development environment. DBAs may
have their own tools to create databases.
3. Querying the database.
This section also should be clearly understood by students. They will need to create SQL
statements, so this part of the lab is crucial. If after forty minutes you see that some
students are still in part 1, suggest that they skip step 2 and do this section.
4. Creating a diagram.
A very brief section, and not too important for the understanding of the Data Perspective
and the data tools.
If students are behind in lab work, try to make sure that they have at least accomplished
the first part and the third part.




7-2   Developing Web Applications                                                 © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   Exercise instructions
          Preface
          Open the workspace from the previous lab and add a database connection. Import
          structural information into a new project in Rational Application Developer, and create a
          new structure that will be deployed to a database. Create a diagram to see the
          relationships between the different tables.
          The following references in the exercise instructions represent directory locations in your
          workstation:
                   • <LAB_FILES> : C:LabFiles70
                   • <SDP_DIR> : c:IBMSDP70




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database        7-3
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



7.1. Prepare the Workspace
__ 1. Start Rational Application Developer with the workspace from the previous lab.
      __ a. In the Workspace Launcher dialog, specify <LAB_FILES>workspace as the
            workspace directory (it should already be pointing to that directory from the
            previous lab).




      __ b. Click OK to open the workspace. If this is a new workspace, follow the
            instructions in Appendix A to set up the projects for this exercise.




7-4    Developing Web Applications                                                © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   7.2. Import the Library Database Schema
          __ 2. Create a Data Design project to hold the database information.
              __ a. Switch to the Data perspective. This can be accomplished by selecting Window
                      Open Perspective Other from the main menu and choosing Data from the
                    Select Perspective dialog.
              __ b. Right-click in the Data Project Explorer and select New                        Data Design Project.
              __ c. In the New Data Design Project dialog, enter LibraryData in the Project
                    name field.




              __ d. Click Finish.
          __ 3. Create a connection to the library database that was created in the first exercise.

                      Note

          You will not be able to connect to the database if the test server is running. To stop the
          server, go to the Servers view, right-click the server and select Stop.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database        7-5
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


      __ a. In the Database Explorer view, right-click anywhere in the view and select New
            Connection.




7-6    Developing Web Applications                                                © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ b. In the New Connection dialog, enter the following:
                       - Database Manager: Derby                  10.1
                       - JDBC Driver: Derby Embedded JDBC Driver
                       - Database location: Browse to <LAB_FILES>databaselibrary
                       - Class location: Browse to
                         <SDP_DIR>runtimesbase_v61derbylibderby.jar




              __ c. Click Test Connection to check if the parameters are valid. The following
                    message should display.




              __ d. Click Finish.
          __ 4. Copy the Data model to the LibraryData project.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database        7-7
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


      __ a. In the Database Explorer, expand the library connection to show the library
            database.




      __ b. Drag the library database from the Database Explorer onto the LibraryData
            project in the Data Project Explorer. The Physical Data Model Editor for
            library.dbm will open.




      __ c. Expand the Library connection in the Database Explorer view. It should have the
            following structure. (Note that some systems are not shown at the bottom of the
            image.)




7-8    Developing Web Applications                                                © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   __ 5. Sample the data from the Patron table.
              __ a. In the Database Explorer view, expand the connection to Connections
                       LibraryConnection library LIBRARY Tables.
              __ b. Right-click LIBRARY.PATRON and select Data                         Sample contents.




              __ c. The result is shown in the Data Output view.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database        7-9
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide



7.3. Create and Populate New Database Tables
        With the library database schema copied into the LibraryData project, you can
        examine the database schema even after disconnecting from the actual database.
        You can also create a new database schema within Rational Application Developer
        and export the tables to the actual database.

            Note

Another way to work with a connection offline is to right-click the connection in the
DatabaseExplorer and select Save Offline. Once disconnected, you can right-click the
connection and select Work Offline. Saving the connection offline saves the database
schema, but not the data. Another issue is that you cannot get metrics or live information
from the underlying database management system.



__ 6. Create a new database.
    __ a. In the Data Project Explorer, right-click LibraryData and select New                        Physical
          Data Model.




7-10 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ b. In the New Physical Data Model dialog, enter the following:
                           • Destination Folder: /LibraryData
                           • File name: BOOKSTORE
                           • Database: Derby
                           • Version: 10.1




              __ c. Click Finish. A Physical Data Model editor and a Diagram editor will open for the
                    new database. Close the Diagram editor.
          __ 7. The Data Project Explorer now displays the BOOKSTORE database model.
                Rename the database to BOOKSTORE and the schema to CATALOG.
              __ a. In the Data Project Explorer, select LibraryData Data
                    Models BOOKSTORE.dbm New Database.
              __ b. Either click New Database or use the Properties view to change the name to
                    BOOKSTORE.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-11
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ c. In the Data Project Explorer, select the Schema node below the BOOKSTORE
          database node. Click the node name again and change the name to CATALOG.




    __ d. Save your changes by clicking within the BOOKSTORE.dbm Physical Data
          Model Editor and pressing CTRL+S.
__ 8. Add a new table to the schema.
    __ a. Right-click CATALOG in the Data Project Explorer and select Add Data Object
            Table.




    __ b. Change the table name from Table1 to NewRelease.
    __ c. Select the NewRelease node in the Data Project Explorer.
    __ d. In the Properties view, select the Columns tab.




    __ e. Click the New icon (circled above) to add each of the columns listed below:
                Column 1
                 — Name: title
                 — Data Type: VARCHAR
                 — Length: 30
                Column 2

7-12 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty                    — Name: author
                           — Data Type: VARCHAR
                           — Length: 30
                          Column 3
                           — Name: price
                           — Data Type: DOUBLE
                          Column 4
                           — Name: releasedate
                           — Data Type: DATE




              __ f.   Save your changes by pressing CTRL+S.
          __ 9. With the BOOKSTORE database completed, you can export the schema and table
                to the actual BOOKSTORE Derby database.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-13
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ a. In the Data Project Explorer, right-click BOOKSTORE and select Generate DDL.




    __ b. In the Generate DDL dialog, on the Options page, select the following check
          boxes: Fully qualified name, DROP statements, and CREATE statements.




    __ c. Click Next.
    __ d. Accept the defaults on the Objects page. Click Next.




7-14 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ e. On the Save and Run DDL page, change the File Name to
                    createBookStoreTables.sql. Select the Run DDL on server check box.




              __ f.   Click Next.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-15
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ g. On the Select Connection page, select the Create a new connection check
          box. A new connection is required as this is a different database.




    __ h. Click Next.
    __ i.   On the Connection Parameters page, fill in the following information:
                 • Database Location: <LAB_FILES>databasebookstore
                 • Class Location: Browse to
                   <SDP_DIR>runtimesbase_v61derbylibderby.jar




7-16 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty                    • User ID: CATALOG )




                      Note

          This database does not exist. The Create the database if required check box is selected.
          This means that the Connection URL in the proceeding image will have ;create=true
          appended to the end. This will create the database if it does not exist.
          The User ID will create the schema - (CATALOG in this case).



              __ j.   Click Next. Click Finish on the Summary page.
              __ k. Check that the Data Output view indicates success. Note: There may be a
                    failure related to the attempt to drop the CATALOG schema that does not exist.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-17
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


__ 10. After creating the new schema and new table in the Derby database, you can
       populate it through an SQL/DDL Script.
    __ a. In the Data Project Explorer, right-click the SQL Scripts node and select New
             SQL Statement.




            Note

The createBookStoreTables.sql script was created in the same location.



    __ b. In the New SQL Statement dialog, click SQL Editor first. Enter
          populateNewRelease.sql as the Statement name and select Sample
          Statements from the Statement template drop-down list.




    __ c. Click Finish.




7-18 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ d. The Connection Selection dialog will open to allow the SQL editor to create
                    SQL for a specific database type. Click Use an existing connection and select
                    bookstore from the Existing connections list.




              __ e. Click Finish.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-19
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide




            Information

An SQL editor appears with the text as shown below. Notice that because you selected
Generate sample DML statements, you have four example statements to use in your
SQL file. The SQL is tailored for the type of database specified by the connection.
Note that these statements will not work as-is with the database. The default parameters
need to be changed.




__ 11. Write the SQL statements to populate the NewRelease table.
    __ a. Enter the following lines to replace the template statements. Notice the delete
          statement at the beginning; this statement deletes all existing rows in the
          newrelease table. This is not standard practice for a production environment, but




7-20 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty               it is useful for testing purposes. You can also copy and paste the statements
                      from <LAB_FILES>Datasnippets snippet01.txt.




              __ b. Save the changes.
          __ 12. Run the SQL/DDL script on the database.
              __ a. In the Data Project Explorer, right-click LibraryData                    SQL Scripts
                       populateNewRelease.sql and select Run SQL.
              __ b. In the Connection Selection dialog, click Use an existing connection and
                    select bookstore from the Existing connections list.




              __ c. Click Finish.
              __ d. Check that the Data Output view indicates success. There should be five entries
                    for the script that was just run. The first entry for the SQL Editor is a warning
                    indicating that the NewRelease table was empty when a DELETE was executed.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-21
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


__ 13. Sample the database contents to ensure that the correct data has been populated.
    __ a. In the Database Explorer, right-click the bookstore connection and select
          Refresh.
    __ b. Right-click bookstore bookstore                     Schemas CATALOG                   Tables
            NEWRELEASE, and select Data                       Sample contents.




    __ c. The result is shown in the Data Output view.




7-22 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   7.4. Use the SQL Query Builder to Query the Library Database
                  You will now use the Query builder to display a list of items a patron has on loan.
                  You will join the ITEM, ONLOAN, and PATRON tables to display the patron’s full
                  name, and the title of the items currently loaned to that patron.
          __ 14. Create a select statement in the library database.
              __ a. In the Data Project Explorer, right-click LibraryData Data Models
                       library.dbm library SQL Statements and select New SQL Statement..




              __ b. In the New SQL Statement dialog, enter selectOnLoanItems as the
                    Statement name and choose SELECT as the Statement Template. Click OK.




              __ c. The SQL Builder for selectOnLoans will open.
          __ 15. In the SQL Builder, add the ITEM (alias I), ONLOAN(alias O) and PATRON(alias P)
                 tables to the select. Display the I.TITLE, P.FIRST_NAME and P.LAST_NAME fields
                 in the select. Join I.ITEM_KEY to O.PATRON_ID and O.PATRON_ID to
                 P.PATRON_ID.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-23
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ a. Right-click in the middle pane to add a table to the select statement.




    __ b. In the Add Table dialog, select LIBRARY.ITEM in the Table name list, and enter
          I (uppercase ‘i’) as the Table alias. Click OK.




    __ c. Add two more tables in the same fashion, using the following parameters.
                    Table 2
                 — Table name: LIBRARY.ONLOAN
                 — Table alias: O
                    Table 3
                 — Table name: LIBRARY.PATRON
                 — Table alias: P




    __ d. Specify the fields to display in the SELECT, by selecting the following check
          boxes: TITLE in Table I, and FIRST_NAME and LAST_NAME in Table P.


7-24 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty       __ e. Join the tables, by dragging I.ITEM_KEY to O.ITEM_KEY. Drag O.PATRON_ID
                    to P.PATRON_ID. Lines should appear to indicate a join operation.




          __ 16. Set the sort order in selectOnLoansItems to sort ascending P.LAST_NAME and
                 P.FIRST_NAME.
              __ a. Click the Columns tab near the bottom of the SQL Builder.
              __ b. In the P.LAST_NAME row, select Sort Order to be 1, and select Sort Type
                    Ascending.

                      Note

          Tip to set the Sort Type and Sort Order.
                   • For the Sort Type, select Ascending, and then press TAB.
                   • Do the same for Sort Order.



              __ c. In the P.FIRST_NAME row, select Sort Order to be 2, and select Sort Type to
                    Ascending.




              __ d. The SQL source should now be as follows. Note that carriage returns were
                    added to display the full SQL.




              __ e. Save your changes.
          __ 17. Run the selectOnLoanItems statement in the SQL Builder.



          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-25
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


    __ a. In the SQL Builder, right-click in the SQL pane and select Run SQL.




    __ b. In the Connection Selection dialog, click Use an existing connection and
          select library from the Existing connections list.




    __ c. If you are not connected to the library database, click Reconnect. When
          prompted, enter X as the password. Click Finish.
    __ d. Check the result in the Data Output view.




7-26 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   7.5. Create a Diagram for the Data Tables
          __ 18. Display the tables from the LIBRARY schema in the Library database.
              __ a. In the Data Project Explorer, right-click LibraryData Data Models
                       library.dbm library Library Diagrams and select New Blank
                    Diagram.




              __ b. In the Data Project Explorer, navigate to LibraryData                      Data Models
                       library.dbm library Library folder.
              __ c. Select all five tables, LIBRARY.COPY, LIBRARY.ITEM, LIBRARY.ONLOAN,
                    LIBRARY.PATRON, and LIBRARY.TABLEMAX. You can select multiple items by
                    holding down the CTRL key while clicking on the individual items.
              __ d. Drag the five tables into the Diagram1 editor.
              __ e. The tables should now appear in the diagram with connections signifying their
                    relationships.




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-27
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.
Instructor Exercises Guide


__ 19. Right-click anywhere in the diagram and select Arrange All.




__ 20. Save your changes.




7-28 Developing Web Applications                                                  © Copyright IBM Corp. 2004, 2007
                             Course materials may not be reproduced in whole or in part
                                    without the prior written permission of IBM.
V4.1
                                                                                                   Instructor Exercises Guide



EXempty   7.6. Close the Database Connections
          __ 21. In the Database Explorer view, right-click the Library connection and select
                 Disconnect. This will release the database so that it will be available for later
                 exercises. Do the same for the bookstore connection.
          __ 22. [OPTIONAL] Close the LibraryData project.
              __ a. In the Data Project Explorer, right-click the Library Data project and select
                    Close Project.

          End of exercise




          © Copyright IBM Corp. 2004, 2007                                       Exercise 7. Connect to a Database      7-29
                                      Course materials may not be reproduced in whole or in part
                                             without the prior written permission of IBM.

More Related Content

What's hot

02.egovFrame Development Environment workshop I
02.egovFrame  Development Environment workshop I02.egovFrame  Development Environment workshop I
02.egovFrame Development Environment workshop IChuong Nguyen
 
Preventing Database Perfomance Issues | DB Optimizer
Preventing Database Perfomance Issues | DB OptimizerPreventing Database Perfomance Issues | DB Optimizer
Preventing Database Perfomance Issues | DB OptimizerMichael Findling
 
EMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x TroubleshootingEMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x TroubleshootingHaytham Ghandour
 
EMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design PatternsEMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design PatternsHaytham Ghandour
 
03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book Supplement03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book SupplementChuong Nguyen
 
JavaOne2013: Implement a High Level Parallel API - Richard Ning
JavaOne2013: Implement a High Level Parallel API - Richard NingJavaOne2013: Implement a High Level Parallel API - Richard Ning
JavaOne2013: Implement a High Level Parallel API - Richard NingChris Bailey
 
Part 6 debugging and testing java applications
Part 6 debugging and testing java applicationsPart 6 debugging and testing java applications
Part 6 debugging and testing java applicationstechbed
 
02.egovFrame Development Environment training book
02.egovFrame Development Environment training book02.egovFrame Development Environment training book
02.egovFrame Development Environment training bookChuong Nguyen
 
EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1Haytham Ghandour
 
Three key concepts for java batch
Three key concepts for java batchThree key concepts for java batch
Three key concepts for java batchtimfanelli
 
Module 2: Managing Work Items in Rational Team Concert
Module 2: Managing Work Items in Rational Team ConcertModule 2: Managing Work Items in Rational Team Concert
Module 2: Managing Work Items in Rational Team ConcertIBM Rational software
 
Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007LiquidHub
 
Vsx5 getting started_guide_en
Vsx5 getting started_guide_enVsx5 getting started_guide_en
Vsx5 getting started_guide_enGeraldo Camargo
 
Module 3: Working with Jazz Source Control
Module 3: Working with Jazz Source ControlModule 3: Working with Jazz Source Control
Module 3: Working with Jazz Source ControlIBM Rational software
 

What's hot (20)

Lab4 RTC Builds
Lab4 RTC BuildsLab4 RTC Builds
Lab4 RTC Builds
 
Image Converter
Image ConverterImage Converter
Image Converter
 
02.egovFrame Development Environment workshop I
02.egovFrame  Development Environment workshop I02.egovFrame  Development Environment workshop I
02.egovFrame Development Environment workshop I
 
Preventing Database Perfomance Issues | DB Optimizer
Preventing Database Perfomance Issues | DB OptimizerPreventing Database Perfomance Issues | DB Optimizer
Preventing Database Perfomance Issues | DB Optimizer
 
EMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x TroubleshootingEMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x Troubleshooting
 
EMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design PatternsEMC Documentum xCP 2.0 Design Patterns
EMC Documentum xCP 2.0 Design Patterns
 
Lab1 RTC Overview
Lab1 RTC OverviewLab1 RTC Overview
Lab1 RTC Overview
 
03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book Supplement03.eGovFrame Runtime Environment Training Book Supplement
03.eGovFrame Runtime Environment Training Book Supplement
 
JavaOne2013: Implement a High Level Parallel API - Richard Ning
JavaOne2013: Implement a High Level Parallel API - Richard NingJavaOne2013: Implement a High Level Parallel API - Richard Ning
JavaOne2013: Implement a High Level Parallel API - Richard Ning
 
Part 6 debugging and testing java applications
Part 6 debugging and testing java applicationsPart 6 debugging and testing java applications
Part 6 debugging and testing java applications
 
02.egovFrame Development Environment training book
02.egovFrame Development Environment training book02.egovFrame Development Environment training book
02.egovFrame Development Environment training book
 
EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1EMC Documentum xCP 2.x Tips for application migration v1.1
EMC Documentum xCP 2.x Tips for application migration v1.1
 
Three key concepts for java batch
Three key concepts for java batchThree key concepts for java batch
Three key concepts for java batch
 
Resource lab
Resource labResource lab
Resource lab
 
Module 2: Managing Work Items in Rational Team Concert
Module 2: Managing Work Items in Rational Team ConcertModule 2: Managing Work Items in Rational Team Concert
Module 2: Managing Work Items in Rational Team Concert
 
Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007
 
Vsx5 getting started_guide_en
Vsx5 getting started_guide_enVsx5 getting started_guide_en
Vsx5 getting started_guide_en
 
JavaEE6
JavaEE6JavaEE6
JavaEE6
 
Module 3: Working with Jazz Source Control
Module 3: Working with Jazz Source ControlModule 3: Working with Jazz Source Control
Module 3: Working with Jazz Source Control
 
Lab3 RTC Source Control
Lab3 RTC Source ControlLab3 RTC Source Control
Lab3 RTC Source Control
 

Similar to Lab 4) working with databases

Lab 7b) test a web application
Lab 7b) test a web applicationLab 7b) test a web application
Lab 7b) test a web applicationtechbed
 
Lab 3) create a web application
Lab 3) create a web applicationLab 3) create a web application
Lab 3) create a web applicationtechbed
 
Lab 5a) create a struts application
Lab 5a) create a struts applicationLab 5a) create a struts application
Lab 5a) create a struts applicationtechbed
 
Part 3 web development
Part 3 web developmentPart 3 web development
Part 3 web developmenttechbed
 
Part 7 packaging and deployment
Part 7 packaging and deploymentPart 7 packaging and deployment
Part 7 packaging and deploymenttechbed
 
F7 wc9 zu3701lsg_ai
F7 wc9 zu3701lsg_aiF7 wc9 zu3701lsg_ai
F7 wc9 zu3701lsg_aipiano_girl
 
Hands-On Lab Data Mining - SQL Server
Hands-On Lab Data Mining - SQL ServerHands-On Lab Data Mining - SQL Server
Hands-On Lab Data Mining - SQL ServerSerra Laercio
 
10 sql tips to speed up your database cats whocode.com
10 sql tips to speed up your database   cats whocode.com10 sql tips to speed up your database   cats whocode.com
10 sql tips to speed up your database cats whocode.comKaing Menglieng
 
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
 
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...Amit Singh
 
Myeclipse+Eclipse+J Boss开发Ejb
Myeclipse+Eclipse+J Boss开发EjbMyeclipse+Eclipse+J Boss开发Ejb
Myeclipse+Eclipse+J Boss开发Ejbyiditushe
 
4) databases
4) databases4) databases
4) databasestechbed
 
Part 4 working with databases
Part 4 working with databasesPart 4 working with databases
Part 4 working with databasestechbed
 
Part 5 running java applications
Part 5 running java applicationsPart 5 running java applications
Part 5 running java applicationstechbed
 
Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...
Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...
Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...Banking at Ho Chi Minh city
 
Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007LiquidHub
 

Similar to Lab 4) working with databases (20)

Lab 7b) test a web application
Lab 7b) test a web applicationLab 7b) test a web application
Lab 7b) test a web application
 
Lab 3) create a web application
Lab 3) create a web applicationLab 3) create a web application
Lab 3) create a web application
 
Lab 5a) create a struts application
Lab 5a) create a struts applicationLab 5a) create a struts application
Lab 5a) create a struts application
 
Part 3 web development
Part 3 web developmentPart 3 web development
Part 3 web development
 
Part 7 packaging and deployment
Part 7 packaging and deploymentPart 7 packaging and deployment
Part 7 packaging and deployment
 
F7 wc9 zu3701lsg_ai
F7 wc9 zu3701lsg_aiF7 wc9 zu3701lsg_ai
F7 wc9 zu3701lsg_ai
 
Resourceslab fixed
Resourceslab fixedResourceslab fixed
Resourceslab fixed
 
Java tutorial
Java tutorialJava tutorial
Java tutorial
 
Hands-On Lab Data Mining - SQL Server
Hands-On Lab Data Mining - SQL ServerHands-On Lab Data Mining - SQL Server
Hands-On Lab Data Mining - SQL Server
 
10 sql tips to speed up your database cats whocode.com
10 sql tips to speed up your database   cats whocode.com10 sql tips to speed up your database   cats whocode.com
10 sql tips to speed up your database cats whocode.com
 
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
 
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
 
Myeclipse+Eclipse+J Boss开发Ejb
Myeclipse+Eclipse+J Boss开发EjbMyeclipse+Eclipse+J Boss开发Ejb
Myeclipse+Eclipse+J Boss开发Ejb
 
4) databases
4) databases4) databases
4) databases
 
Part 4 working with databases
Part 4 working with databasesPart 4 working with databases
Part 4 working with databases
 
SSDT unleashed
SSDT unleashedSSDT unleashed
SSDT unleashed
 
Part 5 running java applications
Part 5 running java applicationsPart 5 running java applications
Part 5 running java applications
 
Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...
Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...
Installing ibm tivoli directory server v6.0 (web sphere partner gateway v6.1 ...
 
Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007Business Solutions Using Office Share Point Server2007
Business Solutions Using Office Share Point Server2007
 
Fp201 unit1 1
Fp201 unit1 1Fp201 unit1 1
Fp201 unit1 1
 

More from techbed

1456.base boot
1456.base boot1456.base boot
1456.base boottechbed
 
1455.ata atapi standards - 1-7
1455.ata atapi standards - 1-71455.ata atapi standards - 1-7
1455.ata atapi standards - 1-7techbed
 
1454.ata features
1454.ata features1454.ata features
1454.ata featurestechbed
 
1432.encoding concepts
1432.encoding concepts1432.encoding concepts
1432.encoding conceptstechbed
 
Flash cs4 tutorials_2009
Flash cs4 tutorials_2009Flash cs4 tutorials_2009
Flash cs4 tutorials_2009techbed
 
Photoshop tut
Photoshop tutPhotoshop tut
Photoshop tuttechbed
 
What is struts_en
What is struts_enWhat is struts_en
What is struts_entechbed
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-entechbed
 
Lab 1) rad installation
Lab 1) rad installationLab 1) rad installation
Lab 1) rad installationtechbed
 
6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testingtechbed
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deploymenttechbed
 
5) running applications
5) running applications5) running applications
5) running applicationstechbed
 
3) web development
3) web development3) web development
3) web developmenttechbed
 
2009 ibm academic initiative
2009 ibm academic initiative2009 ibm academic initiative
2009 ibm academic initiativetechbed
 
2) java development
2) java development2) java development
2) java developmenttechbed
 

More from techbed (15)

1456.base boot
1456.base boot1456.base boot
1456.base boot
 
1455.ata atapi standards - 1-7
1455.ata atapi standards - 1-71455.ata atapi standards - 1-7
1455.ata atapi standards - 1-7
 
1454.ata features
1454.ata features1454.ata features
1454.ata features
 
1432.encoding concepts
1432.encoding concepts1432.encoding concepts
1432.encoding concepts
 
Flash cs4 tutorials_2009
Flash cs4 tutorials_2009Flash cs4 tutorials_2009
Flash cs4 tutorials_2009
 
Photoshop tut
Photoshop tutPhotoshop tut
Photoshop tut
 
What is struts_en
What is struts_enWhat is struts_en
What is struts_en
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-en
 
Lab 1) rad installation
Lab 1) rad installationLab 1) rad installation
Lab 1) rad installation
 
6) debugging and testing
6) debugging and testing6) debugging and testing
6) debugging and testing
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deployment
 
5) running applications
5) running applications5) running applications
5) running applications
 
3) web development
3) web development3) web development
3) web development
 
2009 ibm academic initiative
2009 ibm academic initiative2009 ibm academic initiative
2009 ibm academic initiative
 
2) java development
2) java development2) java development
2) java development
 

Recently uploaded

SOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptx
SOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptxSOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptx
SOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptxSyedNadeemGillANi
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?TechSoup
 
Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...
Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...
Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...Dr. Asif Anas
 
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...M56BOOKSTORE PRODUCT/SERVICE
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17Celine George
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17Celine George
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfYu Kanazawa / Osaka University
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
Work Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sashaWork Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sashasashalaycock03
 
Riddhi Kevadiya. WILLIAM SHAKESPEARE....
Riddhi Kevadiya. WILLIAM SHAKESPEARE....Riddhi Kevadiya. WILLIAM SHAKESPEARE....
Riddhi Kevadiya. WILLIAM SHAKESPEARE....Riddhi Kevadiya
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfMohonDas
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...Nguyen Thanh Tu Collection
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 
Protein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptxProtein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptxvidhisharma994099
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 

Recently uploaded (20)

SOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptx
SOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptxSOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptx
SOLIDE WASTE in Cameroon,,,,,,,,,,,,,,,,,,,,,,,,,,,.pptx
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
 
Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...
Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...
Unveiling the Intricacies of Leishmania donovani: Structure, Life Cycle, Path...
 
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...KARNAADA.pptx  made by -  saransh dwivedi ( SD ) -  SHALAKYA TANTRA - ENT - 4...
KARNAADA.pptx made by - saransh dwivedi ( SD ) - SHALAKYA TANTRA - ENT - 4...
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
Work Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sashaWork Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sasha
 
Riddhi Kevadiya. WILLIAM SHAKESPEARE....
Riddhi Kevadiya. WILLIAM SHAKESPEARE....Riddhi Kevadiya. WILLIAM SHAKESPEARE....
Riddhi Kevadiya. WILLIAM SHAKESPEARE....
 
Diploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdfDiploma in Nursing Admission Test Question Solution 2023.pdf
Diploma in Nursing Admission Test Question Solution 2023.pdf
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 
Protein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptxProtein Structure - threading Protein modelling pptx
Protein Structure - threading Protein modelling pptx
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 

Lab 4) working with databases

  • 1. V4.1 Instructor Exercises Guide EXempty Exercise 7. Connect to a Database Estimated time 01:00 What this exercise is about In this exercise you will explore the Data perspective. You will manipulate database information, both by importing it into Rational Application Developer and by generating a new database and exporting it. What you should be able to do At the end of this lab, you will be able to: • Connect to a database and sample the data • Import the database structure into Rational Application Developer • Create and populate new database tables • Use the SQL Builder to create a SQL statement and query the library database • Create a diagram from the tables Introduction Developers are generally more concerned with examining existing database structures and sampling data, rather than creating new structures and writing them back to the database. Nevertheless, there are times when it is necessary to create a new database for test purposes, and IBM Rational Application Developer (V7 and later) has the tools to do this. This lab takes you through both processes: importing information (both structural and sample data), and exporting artifacts created in Rational Application Developer. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-1 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 2. Instructor Exercises Guide Requirements This exercise requires one code fragment. Make sure that the file appears in the <LAB_FILES> DataSnippets directory before starting the lab. It also requires that the Derby database (LIBRARY) exist. This should have been set up in Lab 1. If it has not been set up, see Appendix A for instructions on how to do this. Instructor exercise overview This exercise divides into four sections, of which the first and third are the most important for developers: 1. Importing structure from a database, and sampling data. There are several different ways to create the project to contain the database structure. The one used in this lab is not necessarily the fastest, but it is expected that students will discover other ways themselves when they need to use this process. Step 3b) has the key screenshot, the dialog where the database type is chosen, the address entered and the connection tested. You should have gone over this in the presentation. It would be good, if there is time, to revisit this dialog after the lab before continuing with the next presentation. 2. Creating structure in Rational Application Developer and exporting it to a database. Students should understand that they would not usually have the permission to create databases this way in the real world! This is strictly a development environment. DBAs may have their own tools to create databases. 3. Querying the database. This section also should be clearly understood by students. They will need to create SQL statements, so this part of the lab is crucial. If after forty minutes you see that some students are still in part 1, suggest that they skip step 2 and do this section. 4. Creating a diagram. A very brief section, and not too important for the understanding of the Data Perspective and the data tools. If students are behind in lab work, try to make sure that they have at least accomplished the first part and the third part. 7-2 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 3. V4.1 Instructor Exercises Guide EXempty Exercise instructions Preface Open the workspace from the previous lab and add a database connection. Import structural information into a new project in Rational Application Developer, and create a new structure that will be deployed to a database. Create a diagram to see the relationships between the different tables. The following references in the exercise instructions represent directory locations in your workstation: • <LAB_FILES> : C:LabFiles70 • <SDP_DIR> : c:IBMSDP70 © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-3 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 4. Instructor Exercises Guide 7.1. Prepare the Workspace __ 1. Start Rational Application Developer with the workspace from the previous lab. __ a. In the Workspace Launcher dialog, specify <LAB_FILES>workspace as the workspace directory (it should already be pointing to that directory from the previous lab). __ b. Click OK to open the workspace. If this is a new workspace, follow the instructions in Appendix A to set up the projects for this exercise. 7-4 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 5. V4.1 Instructor Exercises Guide EXempty 7.2. Import the Library Database Schema __ 2. Create a Data Design project to hold the database information. __ a. Switch to the Data perspective. This can be accomplished by selecting Window Open Perspective Other from the main menu and choosing Data from the Select Perspective dialog. __ b. Right-click in the Data Project Explorer and select New Data Design Project. __ c. In the New Data Design Project dialog, enter LibraryData in the Project name field. __ d. Click Finish. __ 3. Create a connection to the library database that was created in the first exercise. Note You will not be able to connect to the database if the test server is running. To stop the server, go to the Servers view, right-click the server and select Stop. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-5 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 6. Instructor Exercises Guide __ a. In the Database Explorer view, right-click anywhere in the view and select New Connection. 7-6 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 7. V4.1 Instructor Exercises Guide EXempty __ b. In the New Connection dialog, enter the following: - Database Manager: Derby 10.1 - JDBC Driver: Derby Embedded JDBC Driver - Database location: Browse to <LAB_FILES>databaselibrary - Class location: Browse to <SDP_DIR>runtimesbase_v61derbylibderby.jar __ c. Click Test Connection to check if the parameters are valid. The following message should display. __ d. Click Finish. __ 4. Copy the Data model to the LibraryData project. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-7 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 8. Instructor Exercises Guide __ a. In the Database Explorer, expand the library connection to show the library database. __ b. Drag the library database from the Database Explorer onto the LibraryData project in the Data Project Explorer. The Physical Data Model Editor for library.dbm will open. __ c. Expand the Library connection in the Database Explorer view. It should have the following structure. (Note that some systems are not shown at the bottom of the image.) 7-8 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 9. V4.1 Instructor Exercises Guide EXempty __ 5. Sample the data from the Patron table. __ a. In the Database Explorer view, expand the connection to Connections LibraryConnection library LIBRARY Tables. __ b. Right-click LIBRARY.PATRON and select Data Sample contents. __ c. The result is shown in the Data Output view. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-9 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 10. Instructor Exercises Guide 7.3. Create and Populate New Database Tables With the library database schema copied into the LibraryData project, you can examine the database schema even after disconnecting from the actual database. You can also create a new database schema within Rational Application Developer and export the tables to the actual database. Note Another way to work with a connection offline is to right-click the connection in the DatabaseExplorer and select Save Offline. Once disconnected, you can right-click the connection and select Work Offline. Saving the connection offline saves the database schema, but not the data. Another issue is that you cannot get metrics or live information from the underlying database management system. __ 6. Create a new database. __ a. In the Data Project Explorer, right-click LibraryData and select New Physical Data Model. 7-10 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 11. V4.1 Instructor Exercises Guide EXempty __ b. In the New Physical Data Model dialog, enter the following: • Destination Folder: /LibraryData • File name: BOOKSTORE • Database: Derby • Version: 10.1 __ c. Click Finish. A Physical Data Model editor and a Diagram editor will open for the new database. Close the Diagram editor. __ 7. The Data Project Explorer now displays the BOOKSTORE database model. Rename the database to BOOKSTORE and the schema to CATALOG. __ a. In the Data Project Explorer, select LibraryData Data Models BOOKSTORE.dbm New Database. __ b. Either click New Database or use the Properties view to change the name to BOOKSTORE. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-11 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 12. Instructor Exercises Guide __ c. In the Data Project Explorer, select the Schema node below the BOOKSTORE database node. Click the node name again and change the name to CATALOG. __ d. Save your changes by clicking within the BOOKSTORE.dbm Physical Data Model Editor and pressing CTRL+S. __ 8. Add a new table to the schema. __ a. Right-click CATALOG in the Data Project Explorer and select Add Data Object Table. __ b. Change the table name from Table1 to NewRelease. __ c. Select the NewRelease node in the Data Project Explorer. __ d. In the Properties view, select the Columns tab. __ e. Click the New icon (circled above) to add each of the columns listed below: Column 1 — Name: title — Data Type: VARCHAR — Length: 30 Column 2 7-12 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 13. V4.1 Instructor Exercises Guide EXempty — Name: author — Data Type: VARCHAR — Length: 30 Column 3 — Name: price — Data Type: DOUBLE Column 4 — Name: releasedate — Data Type: DATE __ f. Save your changes by pressing CTRL+S. __ 9. With the BOOKSTORE database completed, you can export the schema and table to the actual BOOKSTORE Derby database. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-13 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 14. Instructor Exercises Guide __ a. In the Data Project Explorer, right-click BOOKSTORE and select Generate DDL. __ b. In the Generate DDL dialog, on the Options page, select the following check boxes: Fully qualified name, DROP statements, and CREATE statements. __ c. Click Next. __ d. Accept the defaults on the Objects page. Click Next. 7-14 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 15. V4.1 Instructor Exercises Guide EXempty __ e. On the Save and Run DDL page, change the File Name to createBookStoreTables.sql. Select the Run DDL on server check box. __ f. Click Next. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-15 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 16. Instructor Exercises Guide __ g. On the Select Connection page, select the Create a new connection check box. A new connection is required as this is a different database. __ h. Click Next. __ i. On the Connection Parameters page, fill in the following information: • Database Location: <LAB_FILES>databasebookstore • Class Location: Browse to <SDP_DIR>runtimesbase_v61derbylibderby.jar 7-16 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 17. V4.1 Instructor Exercises Guide EXempty • User ID: CATALOG ) Note This database does not exist. The Create the database if required check box is selected. This means that the Connection URL in the proceeding image will have ;create=true appended to the end. This will create the database if it does not exist. The User ID will create the schema - (CATALOG in this case). __ j. Click Next. Click Finish on the Summary page. __ k. Check that the Data Output view indicates success. Note: There may be a failure related to the attempt to drop the CATALOG schema that does not exist. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-17 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 18. Instructor Exercises Guide __ 10. After creating the new schema and new table in the Derby database, you can populate it through an SQL/DDL Script. __ a. In the Data Project Explorer, right-click the SQL Scripts node and select New SQL Statement. Note The createBookStoreTables.sql script was created in the same location. __ b. In the New SQL Statement dialog, click SQL Editor first. Enter populateNewRelease.sql as the Statement name and select Sample Statements from the Statement template drop-down list. __ c. Click Finish. 7-18 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 19. V4.1 Instructor Exercises Guide EXempty __ d. The Connection Selection dialog will open to allow the SQL editor to create SQL for a specific database type. Click Use an existing connection and select bookstore from the Existing connections list. __ e. Click Finish. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-19 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 20. Instructor Exercises Guide Information An SQL editor appears with the text as shown below. Notice that because you selected Generate sample DML statements, you have four example statements to use in your SQL file. The SQL is tailored for the type of database specified by the connection. Note that these statements will not work as-is with the database. The default parameters need to be changed. __ 11. Write the SQL statements to populate the NewRelease table. __ a. Enter the following lines to replace the template statements. Notice the delete statement at the beginning; this statement deletes all existing rows in the newrelease table. This is not standard practice for a production environment, but 7-20 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 21. V4.1 Instructor Exercises Guide EXempty it is useful for testing purposes. You can also copy and paste the statements from <LAB_FILES>Datasnippets snippet01.txt. __ b. Save the changes. __ 12. Run the SQL/DDL script on the database. __ a. In the Data Project Explorer, right-click LibraryData SQL Scripts populateNewRelease.sql and select Run SQL. __ b. In the Connection Selection dialog, click Use an existing connection and select bookstore from the Existing connections list. __ c. Click Finish. __ d. Check that the Data Output view indicates success. There should be five entries for the script that was just run. The first entry for the SQL Editor is a warning indicating that the NewRelease table was empty when a DELETE was executed. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-21 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 22. Instructor Exercises Guide __ 13. Sample the database contents to ensure that the correct data has been populated. __ a. In the Database Explorer, right-click the bookstore connection and select Refresh. __ b. Right-click bookstore bookstore Schemas CATALOG Tables NEWRELEASE, and select Data Sample contents. __ c. The result is shown in the Data Output view. 7-22 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 23. V4.1 Instructor Exercises Guide EXempty 7.4. Use the SQL Query Builder to Query the Library Database You will now use the Query builder to display a list of items a patron has on loan. You will join the ITEM, ONLOAN, and PATRON tables to display the patron’s full name, and the title of the items currently loaned to that patron. __ 14. Create a select statement in the library database. __ a. In the Data Project Explorer, right-click LibraryData Data Models library.dbm library SQL Statements and select New SQL Statement.. __ b. In the New SQL Statement dialog, enter selectOnLoanItems as the Statement name and choose SELECT as the Statement Template. Click OK. __ c. The SQL Builder for selectOnLoans will open. __ 15. In the SQL Builder, add the ITEM (alias I), ONLOAN(alias O) and PATRON(alias P) tables to the select. Display the I.TITLE, P.FIRST_NAME and P.LAST_NAME fields in the select. Join I.ITEM_KEY to O.PATRON_ID and O.PATRON_ID to P.PATRON_ID. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-23 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 24. Instructor Exercises Guide __ a. Right-click in the middle pane to add a table to the select statement. __ b. In the Add Table dialog, select LIBRARY.ITEM in the Table name list, and enter I (uppercase ‘i’) as the Table alias. Click OK. __ c. Add two more tables in the same fashion, using the following parameters. Table 2 — Table name: LIBRARY.ONLOAN — Table alias: O Table 3 — Table name: LIBRARY.PATRON — Table alias: P __ d. Specify the fields to display in the SELECT, by selecting the following check boxes: TITLE in Table I, and FIRST_NAME and LAST_NAME in Table P. 7-24 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 25. V4.1 Instructor Exercises Guide EXempty __ e. Join the tables, by dragging I.ITEM_KEY to O.ITEM_KEY. Drag O.PATRON_ID to P.PATRON_ID. Lines should appear to indicate a join operation. __ 16. Set the sort order in selectOnLoansItems to sort ascending P.LAST_NAME and P.FIRST_NAME. __ a. Click the Columns tab near the bottom of the SQL Builder. __ b. In the P.LAST_NAME row, select Sort Order to be 1, and select Sort Type Ascending. Note Tip to set the Sort Type and Sort Order. • For the Sort Type, select Ascending, and then press TAB. • Do the same for Sort Order. __ c. In the P.FIRST_NAME row, select Sort Order to be 2, and select Sort Type to Ascending. __ d. The SQL source should now be as follows. Note that carriage returns were added to display the full SQL. __ e. Save your changes. __ 17. Run the selectOnLoanItems statement in the SQL Builder. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-25 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 26. Instructor Exercises Guide __ a. In the SQL Builder, right-click in the SQL pane and select Run SQL. __ b. In the Connection Selection dialog, click Use an existing connection and select library from the Existing connections list. __ c. If you are not connected to the library database, click Reconnect. When prompted, enter X as the password. Click Finish. __ d. Check the result in the Data Output view. 7-26 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 27. V4.1 Instructor Exercises Guide EXempty 7.5. Create a Diagram for the Data Tables __ 18. Display the tables from the LIBRARY schema in the Library database. __ a. In the Data Project Explorer, right-click LibraryData Data Models library.dbm library Library Diagrams and select New Blank Diagram. __ b. In the Data Project Explorer, navigate to LibraryData Data Models library.dbm library Library folder. __ c. Select all five tables, LIBRARY.COPY, LIBRARY.ITEM, LIBRARY.ONLOAN, LIBRARY.PATRON, and LIBRARY.TABLEMAX. You can select multiple items by holding down the CTRL key while clicking on the individual items. __ d. Drag the five tables into the Diagram1 editor. __ e. The tables should now appear in the diagram with connections signifying their relationships. © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-27 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 28. Instructor Exercises Guide __ 19. Right-click anywhere in the diagram and select Arrange All. __ 20. Save your changes. 7-28 Developing Web Applications © Copyright IBM Corp. 2004, 2007 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
  • 29. V4.1 Instructor Exercises Guide EXempty 7.6. Close the Database Connections __ 21. In the Database Explorer view, right-click the Library connection and select Disconnect. This will release the database so that it will be available for later exercises. Do the same for the bookstore connection. __ 22. [OPTIONAL] Close the LibraryData project. __ a. In the Data Project Explorer, right-click the Library Data project and select Close Project. End of exercise © Copyright IBM Corp. 2004, 2007 Exercise 7. Connect to a Database 7-29 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.