首页 > 代码库 > jsp登入oracle

jsp登入oracle

<body>

<%

    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn=null;
    String user=request.getParameter("userName");
    String password=request.getParameter("password"); 
try 
{ 
    conn =DriverManager.getConnection("oracle.jdbc.driver.OracleDriver",user,password); 
    
    out.write("连接成功!");

    Statement st  = conn.createStatement();

    st.close();
    //管理连接
    conn.close();
    
} catch (Exception  e) {
    // TODO 自动生成的 catch 块
    e.printStackTrace();
}
%>

</body>
<body>
<form name=‘frm‘ action=‘dengru.jsp‘>
用户名:<input type="text" name="userName">
密码:<input type="password" name="password">
<input type="submit" value="http://www.mamicode.com/确定">
</form>
</body>

 

jsp登入oracle