java web项目中想要引入opendb.inc文件和power_ora.inc文件,
来达到PHP中,通过require_once引入登录Oracle数据库功能的效果,
(相关部署都是PHP页面写的,我的项目是Javaweb,所以有些不同,不太明白,
php中可以在通过require_once获取,java中我获取不了,
通过<%@ include file="/opendb.inc" %>始终找不到文件,
修改路径,从服务器上获取文件,
<%@ include file="/php/public/opendb.inc" %>
<%@ include file="/php/public/power_ora.inc" %>
但是页面找不到相关文件 /WebRoot/bookAdd.jsp (line: [2], column: [1]) File [/php/public/opendb.inc] not found,
请问这个路径怎么修改)
请问应该怎么做?
因为我的最终目的是借助这两个文件,
登录Oracle数据库获取对应表的数据,
请问需要javaweb在头部如何引入数据库数据表?
恳请指教,感激不尽!
<%@ include file="/php/public/opendb.inc" %> 这个路径肯定不行啊,首先要获取服务器路径,然后再加上你这个路径。
<%
String path = request.getContextPath();
%>
<%@ include file="<%=path%>/php/public/opendb.inc" %>