root cause java.lang.ClassNotFoundException: org.apache.jsp.logindemo01.check_jsp java.net.URLClas
<%@pageimport="java.sql.*"%><%!publicstaticfinalStringDBDRIVER="oracle.jdbc.driver.Or...
<%@ page import="java.sql.*"%>
<%!
public static final String DBDRIVER = "oracle.jdbc.driver.OracleDriver" ;
public static final String DBURL = "jdbc:oracle:thin:10.129.12.70:1522:OSS" ;
public static final String DBUSER = "ADMIN" ;
public static final String DBPASS = "zy" ;
%>
<%
Connection conn = null ;
PreparedStatement pstmt = null ;
ResultSet rs = null ;
boolean flag = false ; // 表示登陆成功或失败的标记
%>
<%
String userid = request.getParameter("userid") ; // 接收表单参数
String password = request.getParameter("password") ; // 接收表单参数
try{
Class.forName(DBDRIVER) ;
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS) ;
String sql = "SELECT userid,name FROM tuser WHERE userid=? AND password=?" ;
pstmt = conn.prepareStatement(sql) ;
pstmt.setString(1,userid) ;
pstmt.setString(2,password) ;
rs = pstmt.executeQuery() ;
if(rs.next()){ 展开
<%!
public static final String DBDRIVER = "oracle.jdbc.driver.OracleDriver" ;
public static final String DBURL = "jdbc:oracle:thin:10.129.12.70:1522:OSS" ;
public static final String DBUSER = "ADMIN" ;
public static final String DBPASS = "zy" ;
%>
<%
Connection conn = null ;
PreparedStatement pstmt = null ;
ResultSet rs = null ;
boolean flag = false ; // 表示登陆成功或失败的标记
%>
<%
String userid = request.getParameter("userid") ; // 接收表单参数
String password = request.getParameter("password") ; // 接收表单参数
try{
Class.forName(DBDRIVER) ;
conn = DriverManager.getConnection(DBURL,DBUSER,DBPASS) ;
String sql = "SELECT userid,name FROM tuser WHERE userid=? AND password=?" ;
pstmt = conn.prepareStatement(sql) ;
pstmt.setString(1,userid) ;
pstmt.setString(2,password) ;
rs = pstmt.executeQuery() ;
if(rs.next()){ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询