各位大侠帮帮忙!!急啊! 把你的程序帖出来,我们可以帮你看看哪儿有错。我们不喜欢直接帮别人写程序。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我要是能些出个程序来就好了!我就是改《JSP设计》中的源码,根本运行不了,那里都是用自己javabean和自定义行为,不改的时候执行不了,后来我建了一个数据库,改了连接也执行不了<%@ page language="java" contentType="text/html" %><%@ taglib uri="/orataglib" prefix="ora" %><ora:useDataSource id="example" className="sun.jdbc.odbc.JdbcOdbcDriver" url="jdbc:odbc:example" /><%-- See if the employee is already defined. If not, insert the info, else update it.--%><ora:sqlQuery id="empDbInfo" dataSource="example"> SELECT * FROM Employee WHERE UserName = ? <ora:sqlStringValue param="userName" /></ora:sqlQuery><% if (empDbInfo.size() == 0) { %> <ora:sqlUpdate dataSource="example"> INSERT INTO Employee (UserName, Password, FirstName, LastName, Dept, EmpDate, EmailAddr, ModDate) VALUES(?, ?, ?, ?, ?, ?, ?, ?) <ora:sqlStringValue param="userName" /> <ora:sqlStringValue param="password" /> <ora:sqlStringValue param="firstName" /> <ora:sqlStringValue param="lastName" /> <ora:sqlStringValue param="dept" /> <ora:sqlDateValue param="empDate" pattern="yyyy-MM-dd" /> <ora:sqlStringValue param="emailAddr" /> <ora:sqlTimestampValue value="<%= new java.util.Date() %>" /> </ora:sqlUpdate><% } else { %> <ora:sqlUpdate dataSource="example"> UPDATE Employee SET Password = ?, FirstName = ?, LastName = ?, Dept = ?, EmpDate = ?, EmailAddr = ?, ModDate = ? WHERE UserName = ? <ora:sqlStringValue param="password" /> <ora:sqlStringValue param="firstName" /> <ora:sqlStringValue param="lastName" /> <ora:sqlStringValue param="dept" /> <ora:sqlDateValue param="empDate" pattern="yyyy-MM-dd" /> <ora:sqlStringValue param="emailAddr" /> <ora:sqlTimestampValue value="<%= new java.util.Date() %>" /> <ora:sqlStringValue param="userName" /> </ora:sqlUpdate><% } %><%-- Get the new or updated data from the database --%><ora:sqlQuery id="newEmpDbInfo" dataSource="example" scope="session"> SELECT * FROM Employee WHERE UserName = ? <ora:sqlStringValue param="userName" /></ora:sqlQuery><%-- Redirect to the confirmation page --%><ora:redirect page="confirmation.jsp" />我用sqlserver建了个数据库,DSN example 连接不上后来用Access建了一个,原文也是用Access的,也连接不上 JSP页面加载的变量使用问题 java的设计模式自己的方案怎么搞 树型菜单点击父节点子节点 TOMCAT6访问页面问题 关于3G的问题???? <c:foreach>循环小问题?? 急!!struts上传文件 中文文件名乱码 关于数据库连接池的一个代码 像阿里巴巴那样的注册的问题 请教:JSP目前开发用那种服务架构比较好? 小问题:为什么不换行? index.jsp#123的#是什么用途啊?
<%@ page language="java" contentType="text/html" %>
<%@ taglib uri="/orataglib" prefix="ora" %><ora:useDataSource id="example"
className="sun.jdbc.odbc.JdbcOdbcDriver"
url="jdbc:odbc:example" /><%--
See if the employee is already defined. If not, insert the
info, else update it.
--%>
<ora:sqlQuery id="empDbInfo" dataSource="example">
SELECT * FROM Employee
WHERE UserName = ?
<ora:sqlStringValue param="userName" />
</ora:sqlQuery><% if (empDbInfo.size() == 0) { %> <ora:sqlUpdate dataSource="example">
INSERT INTO Employee
(UserName, Password, FirstName, LastName, Dept,
EmpDate, EmailAddr, ModDate)
VALUES(?, ?, ?, ?, ?, ?, ?, ?)
<ora:sqlStringValue param="userName" />
<ora:sqlStringValue param="password" />
<ora:sqlStringValue param="firstName" />
<ora:sqlStringValue param="lastName" />
<ora:sqlStringValue param="dept" />
<ora:sqlDateValue param="empDate" pattern="yyyy-MM-dd" />
<ora:sqlStringValue param="emailAddr" />
<ora:sqlTimestampValue value="<%= new java.util.Date() %>" />
</ora:sqlUpdate><% } else { %> <ora:sqlUpdate dataSource="example">
UPDATE Employee
SET Password = ?,
FirstName = ?,
LastName = ?,
Dept = ?,
EmpDate = ?,
EmailAddr = ?,
ModDate = ?
WHERE UserName = ?
<ora:sqlStringValue param="password" />
<ora:sqlStringValue param="firstName" />
<ora:sqlStringValue param="lastName" />
<ora:sqlStringValue param="dept" />
<ora:sqlDateValue param="empDate" pattern="yyyy-MM-dd" />
<ora:sqlStringValue param="emailAddr" />
<ora:sqlTimestampValue value="<%= new java.util.Date() %>" />
<ora:sqlStringValue param="userName" />
</ora:sqlUpdate><% } %><%-- Get the new or updated data from the database --%>
<ora:sqlQuery id="newEmpDbInfo" dataSource="example" scope="session">
SELECT * FROM Employee
WHERE UserName = ?
<ora:sqlStringValue param="userName" />
</ora:sqlQuery><%-- Redirect to the confirmation page --%>
<ora:redirect page="confirmation.jsp" />我用sqlserver建了个数据库,DSN example 连接不上
后来用Access建了一个,原文也是用Access的,也连接不上