0
第29行,它說ORA-00907:缺少右括號 我已經打上了沒有29 我無法行理解缺失缺陷的位置ORA-00907:缺少右parenthesis..An發生異常處理JSP頁面第29行
<%
String r = request.getParameter("t1");
String n = request.getParameter("t2");
String d = request.getParameter("t3");
String b = request.getParameter("t4");
String y = request.getParameter("t5");
String c = request.getParameter("t6");
String bg = request.getParameter("t7");
long cno=Long.parseLong(c);
String x="N.A";
Class.forName("oracle.jdbc.OracleDriver");
Connection cn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "aman", "123456");
PreparedStatement ps = cn.prepareStatement("update icard2 set rollno=(?=r),name=(?),dob=(?),branch=(?),year=(?),contact=(?),bloodgroup=(?),photofile=(?),collname=(?),colllogo=(?) where rollno=r");
ps.setString(1,r);
ps.setString(2,n);
ps.setString(3,d);
ps.setString(4,b);
ps.setString(5,y);
ps.setLong(6,cno);
ps.setString(7,bg);
ps.setString(8,x);
ps.setString(9,x);
ps.setString(10,x);
**29** ps.executeUpdate();
ps.close();
cn.close();
out.println("Record Updated");
%>
永遠不要把SQL代碼到JSP(不創建一個連接每個JSP被調用時 –
'設置rollno =(= R)'是無效,而且你不需要問號周圍的所有括號 –