Usage Note 5023: Using JDBCConnection and JDBCToDataTableAdapter in JSP
When using the JDBCConnection and JDBCToDataTableAdapter in
JavaServerPages, you can drag and drop all of the components onto the
Visuals and edit the values via the Customizer and Properties windows.
The only coding that is required is querying the connection from the
JDBCConnection class and associating that as the MODEL for the
JDBCToDataTableAdapter. This is done by coding the following for the
MODEL property as the example below demonstrates:
<%=JDBCConnection.getConnection() %>
A complete example using the ShareNetDriver is shown below.
<%-- Copyright (c) 2001 by SAS --%>
<%@taglib uri="http://www.sas.com/taglib/sasads" prefix="sasads"%>
<jsp:useBean id="JDBCconnection"
class="com.sas.storage.jdbc.JDBCConnection"
scope="session">
<jsp:setProperty name="JDBCConnection" property="databaseURL"
value="jdbc:sharenet://localhost:5010"/>
<jsp:setProperty name="JDBCConnection" property="driverName"
value="com.sas.net.sharenet.ShareNetDriver"/>
</jsp:useBean>
<jsp:useBean id="JDBCToDataTableAdapter"
class="com.sas.storage.jdbc.JDBCToDataTableAdapter" scope="session">
<jsp:setProperty name="JDBCToDataTableAdapter" property="model"
value="<%=JDBCConnection.getConnection() %>"/>
<jsp:setProperty name="JDBCToDataTableAdapter" property="queryStatement"
value="select * from test.retail"/>
</jsp:useBean>
<sasads:Table id="table1" model="JDBCToDataTableAdapter"
useColumnHeadings="true" maxRows="25"
maxColumns="10" scope="session" />
Operating System and Release Information
| SAS System | SAS AppDev Studio | Microsoft Windows NT Workstation | 2.0 | | 8.2 TS2M0 | |
| Microsoft Windows 95/98 | 2.0 | | 8.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | |
| Topic: | Software Components ==> webAF
|
| Date Modified: | 2009-02-06 15:24:15 |
| Date Created: | 2001-05-21 13:32:38 |