This example uses the Enterprise Portal sample database to illustrate how to use a JNDI data source resource in the definition of a database portlet.
Creating a database element using a connection
cache reference
Log in to Web Studio, select build Portlets, then click New to access the Portlet Builder.
When the Portlet Builder displays, click the down-arrow to the right of the Add button, and select Database Element.
When the Web Studio – New Element window appears, select the Connection Cache option.
Complete these fields:
Conn Cache Name – enter the name of the connection cache for the sample database:
sampledb
SQL Query String – enter this SQL statement as one line:
select c.lname, p.name, si.quantity, si.id, si.prod_id from customer c, sales_order s, sales_order_items si, product p where c.id = s.cust_id and s.id = si.id and si.prod_id = p.id
Click Preview. You see the data that corresponds to the SQL query.
Click Next.
On the next three windows (Add Split Rule, Define Record Layout, and Add Filter Rule), click Next to bypass the options. See the Enterprise Portal Developer’s Guide, Chapter 5, “Data-capable post-processing options” for descriptions of these options.
In the Window Preview, enter Sales
Update
for the Element Name, then click Next.
In the Continuous Capture window, click Finish. Do not click Continue in this window.
Back in the Portlet Builder, click Save and complete the options on the Web Studio – New Portlet Finish window.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |