我正在使用 Oracle 应用服务器 10.1.2.0.2。我正在尝试将 oracle 数据库与 jsp 登录页面连接..稍后将重定向到表单。现在我只是想将我的页面与数据库连接起来。
我的“connect.jsp”在目录“C:\DevSuiteHome2\forms\j2ee\formsapp\formsweb”中
我可以通过http://p---w0--4.lo-----a.com:8889/forms/helloworld.jsp [工作 jsp 文件]访问 jsp 文件
connect.jsp的源代码:
<%@ page import="java.sql.*" %>
<HTML>
<HEAD>
<TITLE>Simple JSP/Oracle Query Example</TITLE>
</HEAD>
<BODY>
<%
Class.forName("oracle.jdbc.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@p---w0--4.lo---a.com:8889:xii", "i----er", "i----er");
// @//machineName:port:SID, userid, password
%>
</BODY>
</HTML>
现在当我尝试访问:http ://p---w0--4.lo-----a.com:8889/forms/connect.jsp它给出了以下错误:
500 Internal Server Error java.sql.SQLException: Io exception: Bad packet type at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)在 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:286) 在 oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:327) 在 oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:433)在 oracle.jdbc.driver.T4CConnection.(T4CConnection.java:150) 在 oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:31) 在 oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:571)在 java.sql.DriverManager.getConnection(DriverManager.java:512) 在 java.sql.DriverManager.getConnection(DriverManager.java:171) 在 _loginbox._check1._jspService(_check1.java:50) [SRC:/LOGINBOX/check1.jsp:12] 在 com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) 在 oracle。 jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) 在 oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) 在 oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) 在 javax com.evermind 上的 .servlet.http.HttpServlet.service(HttpServlet.java:853)[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1. 2.0.2)]。server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0) .2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) 在 java.lang.Thread.run(Thread.java:534)evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) )].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) 在 java.lang.Thread.run(Thread.java:534)evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) )].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186) 在 java.lang.Thread.run(Thread.java:534)
您的回复将不胜感激。我是初学者所以请原谅一些新手问题