Sunteți pe pagina 1din 12

How t o Use Your SAP Net Weaver

Devel oper St udi o (NWDS)


Composi t i on Envi r onment (CE) as
a Dat abase Cl i ent .
Applies to:
SAP Netweaver CE, SAP Netweaver NWDS CE, Composition Environment, NWDS J 2EE Perspective,
Databases in NWDS CE.
Summary
Many a times developers dealing with Databases feel the need of a good database client. An application,
that provides quick access to the Database schema and the records, rather than writing queries for
everything, whenever you need to find some information from the database. The NWDS CE provides the
developers with a good Database Client that meets the Developers most of the requirements. This
document will teach all the steps to use NWDS CE as a Database Client.
Author: Amol Gupta
Company: Wipro Technologies
Created on: 7 August 2009
Author Bio
Amol Gupta has been working with Wipro Technologies as a Technical Consultant. He has
been working on Web Dynpro programming, Enterprise Portal Content Management, MDM
J ava API, MDM Console, MDM Data Manager, Interactive forms for Web Dynpro J ava. He also
knows a bit of J ava (SCJ P) and ABAP programming.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 1
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
Table of Contents
Assumptions ....................................................................................................................................................... 3
Prerequisites ....................................................................................................................................................... 3
Outcome ............................................................................................................................................................. 3
1). Open the J ava EE Perspective ..................................................................................................................... 4
2). Go to Data Source Explorer ->Databases ->New ->Generic Database Connection. ................................ 5
3). Click on Next and enter Database Name and Description. Click Next again. ............................................... 5
4). Click on next and then click on the button with three dots to select your Database Type, choose
your Database Type and Version and click on Add. .......................................................................................... 6
5). Enter the Driver Name in the Dialog Box that appears. ................................................................................ 6
6). Next you will be prompted to provide the Driver jar for the Database. .......................................................... 7
7). Browse the appropriate Database Driver J ar from your file .......................................................................... 7
8). You selected Database Driver J AR file shows up in the Dialog box. ............................................................ 8
9). Edit the Database Connection Properties in the lower half of the last screenshot. ...................................... 8
10). Now choose the newly created My_Oracle_Driver and click OK. ............................................................ 9
11). The New Dialog box will show your selected Driver and edited properties in one view. Test your
Connection. ......................................................................................................................................................... 9
12). Ping succeeded. Click on Finish ............................................................................................................... 10
13). Your newly created Database can be seen............................................................................................... 10
14). Connect to the Database. .......................................................................................................................... 10
15). Connected to the Database. ...................................................................................................................... 10
Related Content ................................................................................................................................................ 11
Disclaimer and Liability Notice .......................................................................................................................... 12

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 2
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
Assumptions
This document is for an audience who has been working with SAP Netweaver Developer Studio
(NWDS), know how to use the NWDS and perform the generic activities. The readers are expected to
understand what a database is and what all information is needed from a Database while developing
applications. This document will not explain all the associated concepts like J DBC, Databases etc from
scratch. The focus will be on How to use your NWDS CE as a Database Client.
Prerequisites
You should have SAP Netweaver Developer Studio CE (NWDS) installed on your Desktop,
have a Database installed and the Database server up and running. You need to have a J AR file that
provides drivers to connect to the database. You should have a Database Username and Password to
connect to the Database. Though its not strictly necessary, some knowledge about the SAP NWDS usage
will come in very handy.
Outcome
You will be able to see the nice and easy to comprehend view of the Database. You will see all
the information that you may expect from a Database client. You will be able to see all the Database Tables,
the different columns in a database, the Primary Keys, the Foreign Keys, the Data types and sizes of
respective fields in a table, etc. You will get everything that you may expect from a Database Client that will
facilitate your programming with the Database.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 3
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
1). Open the Java EE Perspective
Start the SAP Netweaver Developer Studio (NWDS) Composition Environment (CE) and Go to Window ->
Open Perspective -> Other -> Java EE -> OK


SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 4
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
2). Go to Data Source Explorer -> Databases -> New -> Generic Database
Connection.
The Databases folders will hold all the Databases that you will be creating.

3). Click on Next and enter Database Name and Description. Click Next again.
Enter some logical name of your database and some description (optional).

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 5
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
4). Click on next and then click on the button with three dots to select your
Database Type, choose your Database Type and Version and click on Add.
(I choose Oracle 9)

5). Enter the Driver Name in the Dialog Box that appears.
Note that Edit New Driver Definition checkbox is checked and Oracle Thin Driver is selected. I enter
My_Oracle_Driver and click on OK. You can write your own Driver name and click on next.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 6
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
6). Next you will be prompted to provide the Driver jar for the Database.
By default a classes12.jar will appear. Select it and click on Remove J ar/Zip. Now Click on Add J ar/Zip.
Classes12.jar happens to be the Driver J ar for the latest versions of the Oracle Database Driver.

7). Browse the appropriate Database Driver Jar from your file system
For my selection of Database there is a ojdbc14.jar. I select it. You have to find the appropriate Driver J AR
for your selection of Database, browse it on your desktops file system, select it and then click on Open.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 7
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
8). You selected Database Driver JAR file shows up in the Dialog box.
See the red rectangle, the JAR you have just chosen will be shown here.

9). Edit the Database Connection Properties in the lower half of the last screenshot.
In the Connection URL field, replace <server>, <1527>and <db>, with the respective actual server name,
port and Database Name respectively. This URL happens to be the exactly same one that you use while
creating a J BBC connection. Replace the Database Name with the actual Database Name. Leave Driver
Class as it is. Enter Database User ID with which you want to log in to the Database and also provide the
right Password. Click OK.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 8
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
10). Now choose the newly created My_Oracle_Driver and click OK.
You can create multiple drivers with different name for a given Database Version. For example, I have
created one earlier by the name of OracleThinDriver.

11). The New Dialog box will show your selected Driver and edited properties in one
view. Test your Connection.
I have edited some text in this screenshot for the sake of maintaining confidentiality about the information
about my servers. Click on Test Connection.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 9
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
12). Ping succeeded. Click on Finish
If all the entries you entered are appropriate, you will get a Ping succeeded! After that, click Ok, followed by
Finish.

13). Your newly created Database can be seen.
Your database can be seen in the Data Source Explorer tab in the J 2EE Perspective.

14). Connect to the Database.

15). Connected to the Database.
The yellow colored link in the Database Symbol shows that you are connected to the Database just
expand the +sign and start working on your Database Client.

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 10
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
Related Content
SAP Composition Environment
Download NWDS CE EHP1
Create a J DBC Data source and J DBC System
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 11
How to Use Your SAP NetWeaver Developer Studio (NWDS) Composition Environment (CE) as a Database Client.
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2009 SAP AG 12
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not
supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,
and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or
code sample, including any liability resulting from incompatibility between the content within this document and the materials and
services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this
document.

S-ar putea să vă placă și