就是下面这个.jsp文件:
<%@ page contentType="text/html;charset=UTF-8" %>
<jsp:useBean id='clock' scope='page' class='hh.JspCalendar' type="hh.JspCalendar" />
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="workM" scope="page" class="hh.faq" />
<%!
public String getStr(String str)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String temp=new String(temp_t);
return temp;
}
catch(Exception e)
{
}
return "null";
}
%>
<%!String logname,realname,passwd1,passwd2,email,gender,phone;
String problem,answer,province,education,selfintro,hobby,id_seq,nextval;
String[] hobbies;
boolean regAttempt = false;
String errorMessage = "";
int id;
%>
<% //out.print(request.getParameterValues("logname"));
//必须填写的项目
logname=request.getParameter("logname");
realname=request.getParameter("realname");
passwd1=request.getParameter("passwd1");
passwd2=request.getParameter("passwd2");
email=request.getParameter("email");
gender=request.getParameter("Gender");
//非必须填写的项目
phone=request.getParameter("phone");
if(phone.trim().equals("")){
phone=null;
}
problem=request.getParameter("problem");
if(problem.trim().equals("")){
problem=null;
}
answer=request.getParameter("answer");
if(answer.trim().equals("")){
answer=null;
}
province=request.getParameter("Province");
if(province.trim().equals("")){
province=null;
}
education=request.getParameter("education");
if(education.trim().equals("")){
education=null;
}
hobbies=request.getParameterValues("hobbies");
hobby="";
if(hobbies!=null){
for (int i=0;i<hobbies.length;i++){
hobby=hobby+hobbies[i];
}
}else hobby="null";
selfintro=request.getParameter("selfintro");
if(selfintro.trim().equals("")){
selfintro=null;
}
///转换中文
logname=getStr(logname);
realname=getStr(realname);
passwd1 =getStr(passwd1);
email=getStr(email);
gender =getStr(gender);
phone =getStr(phone);
problem =getStr(problem);
answer =getStr(answer);
province =getStr(province);
education=getStr(education);
hobby=getStr(hobby);
selfintro=getStr(selfintro);
%>
<%
String sql="select ID from member where logname='"+logname+"'";
ResultSet RS=workM.executeQuery(sql);
out.println(sql);
int rowscount=0;
try
{
while(RS.next())
{
rowscount++;
}
}
catch(Exception e)
{
}
//count.........
// out.println(rowscount);
if(rowscount==0)
{
regAttempt=true;
}else response.sendRedirect("reg_again.jsp?reg=error");
if(regAttempt==true)
{
String sqlinsert="insert into member(logname,realname,passwd1,email,gender,phone,problem,answer,province,education,hobbies,selfintro,passwd2,id) Values('"+logname+"','"+realname+"','"+passwd1+"','"+email+"','"+gender+"','"+phone+"','"+problem+"','"+answer+"','"+province+"','"+education+"','"+hobby+"','"+selfintro+"','"+passwd2+"','"+id_seq.nextval+"')";//在这里,'"+id_seq.nextval+"'程序报错:id_seq.nextval can not be resolved or is not a field.
out.println(sqlinsert);
workM.executeQuery(sqlinsert);
response.sendRedirect("reg_success.jsp");
}
%>
哪位大侠知道怎么处理此类问题说一下吧,不胜感激!!!