Results 1 to 4 of 4

Thread: driver problem

  1. #1
    arjun_duddu is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Unhappy driver problem

    hii all!!
    i have a problem when i run a jdbc program, it gives me an error by Io Exception: Network adapter could not establish the connection....... please help me out
    Database:
    Oracle 9i

    platform:
    Windows XP

    please help me out!!

  2. #2
    arjun_duddu is offline Member
    Join Date
    Apr 2010
    Posts
    7
    Rep Power
    0

    Default driver problem here goes my code:

    import java.sql.*;

    class JdbcTest {
    public static void main (String args []) throws SQLException {
    // Load Oracle driver
    Statement stmt=null;
    Connection conn=null;
    ResultSet rset=null;
    try{

    Class.forName("oracle.jdbc.driver.OracleDriver");
    // Connect to the local database
    // conn=DriverManager.getConnection("jdbc:oracle:thin :@localhost:1521:orcl","scott", "tiger");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@dss w2k01:1521:orcl","scott", "tiger");

    // Query the employee names
    stmt = conn.createStatement ();
    rset = stmt.executeQuery ("SELECT ename FROM emp");
    }
    catch(Exception e){
    System.out.println(e.getMessage());
    }
    // Print the name out
    while (rset.next ())
    System.out.println (rset.getString (2));

    //close the result set, statement, and the connection
    rset.close();
    stmt.close();
    conn.close();
    }
    }

  3. #3
    Bulelakes is offline Member
    Join Date
    Jul 2010
    Posts
    32
    Rep Power
    0

    Default

    The problem is the driver what IDE a you using ?
    are these two words "dss w2k01"?

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,085
    Rep Power
    20

    Default

    This is not a driver problem, this is either because your hostname or port number are wrong, or the TNS Listener isn't running on the db box.

    Can you ping that server?
    Can you connect to that oracle instance using SQL*Plus?

Similar Threads

  1. Problem finding SQLite JDBC driver
    By PrinceSendai in forum JDBC
    Replies: 9
    Last Post: 08-09-2010, 01:24 AM
  2. mysql driver problem
    By mokingsu in forum JDBC
    Replies: 4
    Last Post: 01-17-2008, 05:27 PM
  3. PostgreSQL driver
    By bugger in forum JDBC
    Replies: 3
    Last Post: 01-11-2008, 09:45 AM
  4. JDBC Driver problem
    By Swamipsn in forum New To Java
    Replies: 3
    Last Post: 08-09-2007, 03:55 PM
  5. JDBC driver connection problem
    By creativehacker in forum JDBC
    Replies: 3
    Last Post: 07-10-2007, 09:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •