Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: the connection refused error
Hi,
hth,
cindy
ktsrikanth wrote:
> Hi
> i ma trying to connect to the oracle database using the following
> code. i get the following error.
>
> java.sql.SQLException: Io exception: Connection
> refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
>
> i have the tnsnames.ora being configured and i am able to connect to
> the database using sqlplus and 0racle net8 easy config. i am using
> weblogic as the servlet engine. i ahve the classes111.zip and
> classes12.zip added to the weblogic classpath as well as to the NT
> classpath(though i think that the NT classpath has nothing to do with
> this).
> Please help me. Thank you
>
> The code is as follows.
> The username and the password are defined in the declaration part.
>
> try
> {
> driver=(Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
> Conn = DriverManager.getConnection
> ("jdbc:oracle:thin:@10.161.36.217:1521:DEVTEST",Username,
> Password);
> }
> catch(Exception connexec)
> {
> out.println("connectionError....."+connexec+"<br>");
> }
>
> try
> {
> String sql="select billing_cde from billing";
> stmt=Conn.prepareStatement(sql);
> rset=stmt.executeQuery(sql);
> while(rset.next())
> {
> out.println(rset.getString("billing_cde"));
> }
> }
> catch(Exception rsetexec)
> {
> out.println("resultset error....."+rsetexec+"<br>");
> }
Received on Mon Sep 17 2001 - 16:36:28 CDT
![]() |
![]() |