我在数据库中输入了 10 个问题,以及他们的答案。我开始了项目,我登录了候选人 ID。之后我给了承认ID,它被接受了。之后我试图打开这个页面(这个页面是用来打开测试页面的,它会打开问题),我得到了错误信息 - java.sql.SQLException: ORA-01017: invalid username/password; 登录被拒绝据我所知,项目编码没有错误。所以我没有发布编码。错误出现在数据库连接的某个地方。(我已经看到其他有此错误的主题,但没有找到帮助)。
{ if(minutes==0 && seconds==0)
{
alert('Oops ! ! Time up '+
'Test Submitted Successfully');
VerbForm.submit();
}
seconds=60;
minutes--;
window.setTimeout("timer()", 1000 );
}
}
" style="border:0px 纯白;背景:#F0EFE2">:" style="border:0px 纯白;背景:#F0EFE2">计时器();
</div>
<div id="site_content">
<div id="content">
<%
try{
int i=1;
Random rand =new Random();
int newrand=rand.nextInt(9);
session.setAttribute("verbrandom",String.valueOf(newrand));
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","java","12345");
String admitid=session.getAttribute("admitid").toString();
int aid=Integer.parseInt(admitid);
PreparedStatement ps1=con.prepareStatement("select verbkey from result where admitid=?");
ps1.setInt(1,aid);
ResultSet rs1=ps1.executeQuery();
rs1.next();
if(rs1.getInt("verbkey")==1)
{
response.sendRedirect("AlreadyExam.jsp");
}
else
{
PreparedStatement ps=con.prepareStatement("select * from verbal where qid>? order by qid");
ps.setInt(1,newrand);
ResultSet rs=ps.executeQuery();
while(rs.next() && i<=10)
{
%>
<form action="VerbalResult.jsp" align="left" name="VerbForm">
<P><b><%=i%>. <%=rs.getString("question")%></b><BR><BR>
" value="<%=rs.getString("option1")%>"> A. <%=rs.getString("option1")%> " value="<%=rs.getString("option2")% >"> B. <%=rs.getString("option2")%>
" value="<%=rs.getString("option3")%>"> C. <%=rs.getString("option3") %> " value="<%=rs.getString("option4")%>"> C. <%=rs.getString("option4")%>
<%
i++;
} rs.close();
ps.close();
}
con.close();
rs1.close();
ps1.close();
}
catch(NullPointerException e)
{
response.sendRedirect("CandidateLogin.jsp");
}
%>
<p><input style="padding-top: 25px; font: 100% arial; border: 1px solid; width: 170px; margin: 0 0 0 212px; height: 33px; padding: 2px 0 3px 0;cursor: pointer;background: #7D0F0F; color: #FFF;" class="submit" type="submit" onclick="DoneTest()" name="TestButton" value="Submit Verbal Test"></p>