<body>

<%

    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection conn=null;
    String user=request.getParameter("userName");
    String password=request.getParameter("password"); 
try 
{ 
    conn =DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:orcl",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'  method="post">
用户名:<input type="text" name="userName">
密码:<input type="password" name="password">
<input type="submit" value="确定">
</form>
</body>

 

 jsp登入oracle

 

相关文章:

  • 2021-12-30
  • 2022-01-08
  • 2022-02-04
  • 2021-04-11
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
猜你喜欢
  • 2022-01-31
  • 2022-12-23
  • 2022-02-18
  • 2022-12-23
  • 2021-04-13
  • 2022-01-07
  • 2021-12-06
相关资源
相似解决方案