Re: Problem Connecting to Oracle DB with JDBC

From: <mga_at_alayon.com>
Date: Fri, 29 May 1998 22:25:33 GMT
Message-ID: <6kncks$e0k$1_at_nnrp1.dejanews.com>


Make sure your listener is listening!

In article <3565dc91.5660222_at_news.iglobal.net>,   gressett_at_iglobal.net (David Gressett) wrote:
>
> Help!!
>
> I am attempting to connect to an Oracle V7.3.2.2 database from a Java
> program running on a Windows 95 workstation. The Java is Sun's
> JDK 1.1.6. The source code is lifted from the Oracle JDBC 7.3.4.0.0
> release notes, with minor mods to match my hostname and Oracle
> instance:
>
> import java.sql.*;
>
> class JdbcTest {
> public static void main (String args[]) throws SQLException {
> DriverManager.registerDriver(new
> oracle.jdbc.driver.OracleDriver());
> Connection conn =
>
> DriverManager.getConnection("jdbc:oracle:thin:orsrv:1521:WG73",
> "scott", "tiger");
> Statement stmt = conn.createStatement();
> ResultSet rset = stmt.executeQuery("select ename from emp");
>
> while (rset.next()) {
> System.out.println(rset.getString(1));
> }
> }
> }
>
> When I run it, it fails with this message:
>
> java.sql.SQLException: connection refused
>
> What am I doing wrong?
> Any help will be greatly appreciated.
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Sat May 30 1998 - 00:25:33 CEST

Original text of this message