In this section, we will create a database table in the Oracle database using the JSTL 1.1 SQL tags in JDeveloper 10.1.3 IDE. The database table will be created using the catalog.jsp JSP, which was created in the Setting the Environment section. The taglib
directives for the JSTL SQL taglib and the JSTL Core taglib shown below get added to the catalog.jsp, because the JSTL SQL 1.1 and JSTL Core 1.1 taglibs were selected while creating the JSP.
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
To access the Oracle database, create a data source with the SQL tag setDataSource
. JDeveloper provides a Component Palette to add JSTL SQL tags to a JSP page. Select the JSTL 1.1 SQL Component Palette. Position the cursor in the JSP page and in the JSTL SQL Component Palette select the SetDataSource tag.
In the setDataSource
tag specify the JDBC driver, oracle.jdbc.OracleDriver
, in...