我正在尝试制作一个程序,它将员工 id 作为输入,并为我获取包含 7 列的整行。但是,我创建了一个过程,但是当我运行它时,它会给出一个错误,指出“标识符无效”。请告诉我我做错了什么?
create or replace procedure getdetails (empid number)
is
stmt varchar2 (1000);
begin
stmt :='select * from myadmin where employe_id=empid';
execute immediate stmt;
end;
/
使用下面的语句执行
begin getdetails (5);
end;
package pack.java;
import pack.java.allrequestmodel;
import java.io.*;
import java.lang.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class allrequestcontrol extends TagSupport
{
HttpServletRequest request;
HttpServletResponse response;
String ss="";
String emp="";
public int doStartTag() throws JspException
{
request=(HttpServletRequest)pageContext.getRequest();
response=(HttpServletResponse)pageContext.getResponse();
return EVAL_PAGE;
}
public ResultSet check()
{
HttpSession mysession=request.getSession();
ss=(String)mysession.getAttribute("user");
mysession.setAttribute("user",ss);
JspWriter out=pageContext.getOut();
Connection con;
CallableStatement stmt;
ResultSet rs=null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch( ClassNotFoundException ex)
{
}
try
{
con= DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","gaurav","oracle");
stmt=con.prepareCall("call getdetails(?)");
stmt.setString(1,ss);
rs=stmt.executeQuery();
}
catch(SQLException ex)
{
}
return rs;
}
public int doEndTag() throws JspException
{
JspWriter out=pageContext.getOut();
ResultSet rs= check();
try
{
out.println("<table border=2>");
out.println("<tr>");
out.println("<th>EmployeId</th>");
out.println("<th>Supervisor</th>");
out.println("<th>Department</th>");
out.println("<th>PickDate.</th>");
out.println("<th>PickTime</th>");
out.println("<th>DropDate</th>");
out.println("<th>DropTime</th>");
out.println("<th>Status</th>");
out.println("<th></th>");
out.println("</tr>");
while(rs.next())
{
out.println("<tr>");
out.println("<td>"+rs.getString(1)+"</td>");
out.println("<td>"+rs.getString(2)+"</td>");
out.println("<td>"+rs.getString(3)+"</td>");
out.println("<td>"+rs.getString(4)+"</td>");
out.println("<td>"+rs.getString(5)+"</td>");
out.println("<td>"+rs.getString(6)+"</td>");
out.println("<td>"+rs.getString(7)+"</td>");
out.println("<td>"+rs.getString(8)+"</td>");
out.println("<td><input type=radio name=radio value="+rs.getString(8)+"></td>");
out.println("</tr>");
}
emp=(String)request.getParameter("radio");
HttpSession mysession=request.getSession();
mysession.setAttribute("deleteemp",emp);
}
catch(Exception ex)
{
}
return super.doEndTag();
}
}