Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problems connecting to Oracle from a servelet

0 views
Skip to first unread message

Maggie Evans

unread,
Aug 3, 2002, 12:56:05 PM8/3/02
to
i'm having trouble connecting to an Oracle database from an JPL page.
i'm using Oracle 8i Personal on my local machine.
i'm trying to follow the example in a text with the following...

<%@ page import = "java.sql.*" %>
<%

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con = DriverManager.getConnection
("jdbc:odbc:oraDSN","scott", "tiger" );

%>

but, alas, it does not work. i get the error message below. can some
kind hearted java person help me with this.

i have a DSN called oraDSN. the listener works

thanks in advance for any help.

maggie


javax.servlet.ServletException: [Oracle][ODBC][Ora]Server rejected the
connection.
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:386)
at
src.bean_0005fmachine._0002fsrc_0002fbean_0005fmachine_0002fJsp_00031_0002ej
spJsp1_jsp_20._jspService(_0002fsrc_0002fbean_0005fmachine_0002fJsp_00031_00
02ejspJsp1_jsp_20.java:118)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:174)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)
at
com.borland.jbuilder.webserverglue.tomcat.jsp.JspLoaderEcho.service(Unknown
Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)

Jon Skeet

unread,
Aug 3, 2002, 1:32:00 PM8/3/02
to
Maggie Evans <xtx...@hotmail.com> wrote:
> i'm having trouble connecting to an Oracle database from an JPL page.
> i'm using Oracle 8i Personal on my local machine.
> i'm trying to follow the example in a text with the following...
>
> <%@ page import = "java.sql.*" %>
> <%
>
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

I would *strongly* recommend using the Oracle type 4 driver rather than
the JDBC ODBC bridge - the bridge is incredibly buggy, IME. That may
well solve your problem, too.

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too

Silvio Bierman

unread,
Aug 3, 2002, 1:39:08 PM8/3/02
to
As Jon suggests: drop the ODBC bridge, it is useless for all production
purposes. Your problem might be caused by the DSN being a user DSN instead
of a system DSN? Use the Oracle thin JDBC driver and it should work.

Silvio Bierman

"Maggie Evans" <xtx...@hotmail.com> wrote in message
news:FWT29.91569$f05.4...@news1.calgary.shaw.ca...
: i'm having trouble connecting to an Oracle database from an JPL page.

:
:
:


0 new messages