把你的程序帖出来,我们可以帮你看看哪儿有错。
我们不喜欢直接帮别人写程序。

解决方案 »

  1.   

    我要是能些出个程序来就好了!我就是改《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的,也连接不上