blob: 626f61454bc6711cd8f3ffb49160f5d476d2b546 [file] [log] [blame]
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<title>WST</title>
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
{font-family:PMingLiU;
panose-1:2 1 6 1 0 1 1 1 1 1;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"\@PMingLiU";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
h1
{margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
page-break-after:avoid;
font-size:16.0pt;
font-family:Arial;}
h3
{margin-top:12.0pt;
margin-right:0in;
margin-bottom:3.0pt;
margin-left:0in;
page-break-after:avoid;
font-size:13.0pt;
font-family:Arial;}
span.Heading3Char
{font-family:Arial;
font-weight:bold;}
ins
{text-decoration:none;}
span.msoIns
{text-decoration:underline;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
/* List Definitions */
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</head>
<body lang=EN-US>
<div class=Section1>
<h1 align=center style='text-align:center'>RDB Tutorial</h1>
<p class=MsoNormal>This document walks you through the relational database (RDB)
open source features in the Eclipse Web Tooling Project.  You must have either
the RDB open source binaries or the source code downloaded from the Eclipse Web
site. </p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>The supported features include the following:</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><b>Connection Wizard</b> – Create a live connection to the
database server using the JDBC driver.</p>
<p class=MsoNormal style='text-indent:0in'><b>Data Output view</b> – View the
messages, parameters, and results that are related to the database objects that
you work with.</p>
<p class=MsoNormal><b>Database Explorer</b> – Support the live view of database
server elements including tables, views, stored procedures, and user-defined
functions. In the Database Explorer, you can also view a database sever in an
offline mode.</p>
<p class=MsoNormal><b>Data Browse</b> – Browse table content from the connected
database server.</p>
<p class=MsoNormal><b>SQL Scrapbook</b> – A SQL utility/editor which can be
used to construct SQL commands to be executed to a connected server in the Database
Explorer.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>Opening
the RDB related view</span></span><br>
<br>
</p>
<p class=MsoNormal>Click Window -&gt; Show View -&gt; Others -&gt; Data, then select
<b>Data Output</b> and <b>Database Explorer</b>.</p>
<p class=MsoNormal style='text-indent:0in'><span class=msoIns><ins
cite="mailto:IBM_USER" datetime="2006-06-08T16:12">&nbsp;</ins></span></p>
<p class=MsoNormal><span class=msoIns><ins cite="mailto:IBM_USER"
datetime="2006-06-08T16:12"><img width=276 height=401
src="images/image001.jpg"></ins></span></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>Creating
a new connection using the Connection wizard</span></span></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>To create a new connection using the Connection wizard:</p>
<p class=MsoNormal>&nbsp;</p>
<ol style='margin-top:0in' start=1 type=1>
<li class=MsoNormal>In the Database Explorer window, click the <b>New
Connection </b>toolbar button.</li>
<li class=MsoNormal>Select the database that you would like to connect to, and
fill in the JDBC connection information.</li>
</ol>
<p class=MsoNormal style='margin-left:.25in'><br>
Note: The <b>Test Connection</b> and <b>Next</b> buttons will not show up
unless all of the required information has been filled in.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>To connect to a Derby database:<br>
<br>
</p>
<p class=MsoNormal style='margin-left:.5in'><img width=576 height=530
src="images/image002.jpg"></p>
<p class=MsoNormal style='margin-left:.5in'>&nbsp;</p>
<p class=MsoNormal style='margin-left:.5in'>&nbsp;</p>
<p class=MsoNormal style='margin-left:.75in;text-indent:-.25in'><span
style='font-family:Symbol'>·<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span>To connect to the SQL Server 2000 database:<br>
<br>
Note:  If you are connecting to SQL Server 2000 using the MS JDBC driver, you
must specify the path to the three required jar files (for example, mssqlserver.jar,
msbase.jar, and msutil.jar).</p>
<p class=MsoNormal style='margin-left:.5in'><br>
<img width=576 height=440 src="images/image003.jpg"></p>
<p class=MsoNormal style='margin-left:.5in'>&nbsp;</p>
<p class=MsoNormal style='margin-left:.25in'>3.   Click <b>Test Connection</b>.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal style='margin-left:.25in'><img width=441 height=146
src="images/image004.jpg"></p>
<p class=MsoNormal style='margin-left:.25in'>&nbsp;</p>
<ol style='margin-top:0in' start=3 type=1>
<li class=MsoNormal>Click OK to close the confirmation window, then click <b>Next</b>.</li>
<li class=MsoNormal>Set filters as appropriate.  You can also filter after the
connection is made.<br>
<br>
In a future milestone, you will be able to filter schemas, tables, views,
stored procedures, and so on, from the folder in your Database Explorer.</li>
<li class=MsoNormal>Click <b>Finish</b>.</li>
</ol>
<p class=MsoNormal style='margin-left:.25in'>&nbsp;</p>
<p class=MsoNormal style='margin-left:.25in'>In the Database Explorer, expand
the Server node and view the folders for schemas, tables, views, stored
procedures, and so on.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal style='margin-left:.25in'><img width=502 height=161
src="images/image005.gif"></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>Reconnecting
to a server from the Database Explorer</span></span></p>
<p class=MsoNormal><br>
From the Database Explorer, you can reconnect to a server.  Right-click on the
disconnected server, and select <b>Reconnect</b>.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><img width=440 height=180
src="images/image006.gif"></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>Work offline in Database Explorer:<br>
<br>
</p>
<p class=MsoNormal>To save a new object in the Database Explorer, right-click a
server connection, and select <b>Save Offline</b>.  Currently, the Database Explorer
only supports read-only mode.  You can get read/write mode by generating a DDL
to run on the database Server.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><img width=338 height=181
src="images/image007.gif"></p>
<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>&nbsp;</span></span></p>
<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>Browse
Data feature</span></span></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>To browse data:</p>
<p class=MsoNormal><br>
In the Database Explorer, right-click a table, and select <b>Data -&gt; Sample
Contents</b>.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><img width=547 height=166
src="images/image008.gif"></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>Here is an example of a result set of a table with data:<br>
 </p>
<p class=MsoNormal><img width=576 height=139
src="images/image009.jpg"></p>
<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>&nbsp;</span></span></p>
<p class=MsoNormal><span class=Heading3Char><span style='font-size:13.0pt'>Opening
the SQL Scrapbook</span></span><br>
<br>
</p>
<p class=MsoNormal>To open the SQL Scrapbook, you must have a project and a folder
created.  You can open the SQL Scrapbook in two different ways:</p>
<p class=MsoNormal>&nbsp;</p>
<ol style='margin-top:0in' start=1 type=1>
<li class=MsoNormal>From the Database Explorer, click the <b>Open SQL
Scrapbook </b>icon.<br>
<br>
<img width=575 height=125 src="images/image010.jpg"><br>
<br>
</li>
<li class=MsoNormal>Choose a connection to associate your scrapbook with.<br>
<br>
<img width=306 height=227 src="images/image011.gif"><br>
<br>
</li>
<li class=MsoNormal>Specify a folder name and a name for your sqlpage file.<br>
<br>
</li>
</ol>
<p class=MsoNormal><u>OR<br>
<br>
</u></p>
<ol style='margin-top:0in' start=1 type=1>
<li class=MsoNormal>Select the folder.</li>
<li class=MsoNormal>Click <b>File -&gt; New -&gt; Other, </b>expand the <b>Data</b>
node and click<b> SQL Scrapbook Page</b>.<br>
<br>
</li>
</ol>
<p class=MsoNormal style='margin-left:.25in'><img width=500 height=500
src="images/image012.gif"><br>
<br>
</p>
<ol style='margin-top:0in' start=3 type=1>
<li class=MsoNormal>Click <b>Next</b>.</li>
<li class=MsoNormal>Type a name for your sqlpage file.  For example,
CreateTable.sqlpage.</li>
<li class=MsoNormal>Click <b>Finish</b>. The SQL Scrapbook opens in the editor
area.</li>
<li class=MsoNormal>Right-click in a blank space in the SQL Scrapbook and
select <b>Use Database Connection</b>. The Connection Selection window
opens.  <br>
<br>
<img width=410 height=567 src="images/image013.gif"><br>
<br>
</li>
<li class=MsoNormal>Select a server, and click <b>OK</b>.<br>
<br>
</li>
</ol>
<p class=MsoNormal style='margin-left:.5in'><img width=576 height=530
src="images/image014.jpg"></p>
<p class=MsoNormal>You can now start typing a SQL statement in the SQL
scrapbook.  For example, <br>
<br>
</p>
<p class=MsoNormal><span style='font-family:Courier'>Create table APP.Parent
(col1 integer not null, col2 char(11), primary key(col1))<br>
<br>
</span></p>
<p class=MsoNormal>To run the SQL, click <b>Run &gt; Run SQL</b> from the main
menu. <br>
<br>
</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>After you run the SQL, the view is automatically refreshed. 
If you want to manually refresh the view, right-click the folder in the Database
Explorer, and select <b>Refresh</b>.</p>
<p class=MsoNormal>&nbsp;</p>
</div>
</body>
</html>