1. In idea, the JSTL library is imported into web-inf/lib and can be directly on the JSP page via the
<%@ taglib uri= "http://java.sun.com/jsp/jstl/core" prefix= "c"% >
<%@ taglib uri= "http://java.sun.com/jsp/jstl/sql" prefix= "sql"% >
Import, you do not need to set parameters in Web. Xml. In the idea Web. XML, it seems that the path to the file in the jar package cannot be added to the Lib directory because it cannot be identified.
The 2.JSTL SQL tags are also available for MySQL and Oracle, most of which are MySQL-based, and W3cschool also have jstl to write a tutorial that links to MySQL pages.
MySQL can refer to https://www.w3cschool.cn/jsp/jsp-database-access.html, the inside of the datasource is written like this:
<sql:setdatasource var= "snapshot" driver= "Com.mysql.jdbc.Driver "
Url= "Jdbc:mysql://localhost/test"
user= "root" password= "pass123"/>
Oracle simply changes the driver and URLs in the datasource tag to Oracle, and of course idea needs to import the Oracle14.jar Drive Jar package (which can be found online) using the following:
<sql:setdatasource var= "Ora" driver= "Oracle.jdbc.driver.OracleDriver"
Url= "Jdbc:oracle:thin: @localhost: 1521:orcl"
User= "Scott" password= "123456"/>
3. Using Jstl's sql:query tag, var= "Result", rows is the property of result in query result, ${result.rows} is equivalent to Result.getrows ();
Idea is powered by Tomcat using JSTL to connect to Oracle database