DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Urgent - Database Connectivity

  1. #1
    Join Date
    Oct 2001
    Location
    Doha, Qatar
    Posts
    103

    Red face Urgent - Database Connectivity

    I have a big problem here. I'm working on it since many days but I'm not able to solve it. The problem is that we were running our hospital management package on pramati application server 3.0 which was running on Win-NT 4.0, on Compaq Proliant machine(Server). But recently I wanted to change the O/S to Linux 9.0 as we were facing the virus problems in our Organization. So, We installed Linux 9.0 on the Compaq server and then installed JDK 1.3 and then installed Pramati application server 3.0 sucessfully. But the problem is that we are not able to establish the database connectivity. The database is running in an another machine on which O/S is Win-NT 4.0. we are getting the Network Adapter error. Earlier when we were running Pramati server on Win-NT 4.0 O/S, there were no such problems and it was running smoothly. Even I tried to check the database connectivity using a simple console based program. The program is giving error. The details are given below:

    [root@compaq root]# echo $PATH
    /usr/java/jdk1.3.1_08/bin:.:/usr/java/jdk1.3.1_08/bin:.:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/root/bin
    [root@compaq root]# echo $CLASSPATH
    /usr/java/jdk1.3.1_08/jre/lib/ext
    [root@compaq root]# cat GetTables.java
    import java.sql.*;
    import java.io.*;

    class GetTables
    {

    static String driver="oracle.jdbc.driver.OracleDriver";
    static String url="jdbc:oracle:thin:@192.168.100.254:1521:ghdb";
    static String username="globalit";
    static String password="globalit";

    public static void main(String args[]) throws Exception
    {
    Class.forName(driver);
    Connection conn =null;
    try{
    System.out.println("Trying to connect");
    conn =
    DriverManager.getConnection(url,username,password);
    System.out.println("Got Connection : ");
    Statement stmt = conn.createStatement();
    System.out.println(conn.getMetaData());
    /* ResultSet rs =
    conn.getMetaData().getTables(null,"%","%",null);
    while (rs.next())
    {
    System.out.println("schema name ="+
    rs.getString("TABLE_SCHEM")+ " table name ="+ rs.getString("TABLE_NAME"));
    }*/
    System.out.println("done...........");
    }
    catch(Exception ex)
    {
    ex.printStackTrace();
    }
    finally
    {
    conn.close();
    }
    }

    }
    [root@compaq root]#
    [root@compaq root]# javac GetTables.java
    [root@compaq root]# java GetTables
    Trying to connect
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:263)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:172)
    at GetTables.main(GetTables.java:18)
    Exception in thread "main" java.lang.NullPointerException
    at GetTables.main(GetTables.java:38)
    [root@compaq root]#


    So, I want to know what exactly is the cause. Please help me.

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    The cause is your networking is not setup correctly.

    Orignally posted by slimdave
    Crystal ball broken today -- please post the tnsnames.ora, sqlnet.ora, and the connect string you are using.
    Also, can you connect via sqlplus?
    Jeff Hunter

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    can you ping 192.168.100.254 ?
    Is the listener up?
    Jeff Hunter

  4. #4
    Join Date
    Oct 2001
    Location
    Doha, Qatar
    Posts
    103
    I am able to ping 192.168.100.254
    and even I'm able to open the admin page of the application server from the machine on which the datbase is running(192.168.100.254). But, I'm not able to establish database connectivity. Now as a standy, We are running the application server, Pramati 3.0 on another windows 2000 machine(Desktop PC with 512 MB RAM and P3 procesor) which is connected to the database and users are using the hopital manageent package succesfully which means that Listener is up and running and database is running fine. But, I don't know what exactly is the reason in the case of compaq server, as I'm able to compile and run the console based JDBC program which is printing the text ('Trying to connect') out put to console before entering the connectivity code in the program and then the program is giving exceptions when it's entering the part where database connectivity is being established, which is clear above, in the details which I provided. Please Help me. Also, I have not installed any SQL-Net components or Oracle Client on Linux 9.0 (Compaq Server) machine whcih is running the application server as it uses the classes12.jar file whcih has the required Oracle Drivers for establishing the connectivity. I want to know whether it's required to install the Oracle Networking components on the machine which is running the application server.
    Last edited by tvrdileep; 07-10-2003 at 03:43 AM.

  5. #5
    Join Date
    Jul 2001
    Location
    Slovenia
    Posts
    422
    You don't need Oracle Client if you are using thin JDBC.
    You haven't say if you can connect with SQLPlus - you need Oracle Client for this, though.
    Tomaž
    "A common mistake that people make when trying to design something completely
    foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams

  6. #6
    Join Date
    Oct 2001
    Location
    Doha, Qatar
    Posts
    103
    I have'nt installed the Oracle client or any Oracle software in the Linux machine(Compaq Server). So, I can't use the SQL/PLUS to connect to the database. But, I'm able to connect to the database using SQL/PLUS from other systems.

  7. #7
    Join Date
    Jul 2001
    Location
    Slovenia
    Posts
    422
    Can you establish this thin JDBC connection from other machines?
    Does your listener listen on port 1521?
    Tomaž
    "A common mistake that people make when trying to design something completely
    foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams

  8. #8
    Join Date
    Oct 2001
    Location
    Doha, Qatar
    Posts
    103
    Hai Tomazz. The Pramati application server is running another machine(Win 2000) and the users are using the hospital management package successfully which is connected to database by Oracle Thin Driver. That means the Oracle Thin Driver is working fine from another machines. The Listener is up and running and is listening on port 1521. What could be the problem from this machine I don't know....
    Last edited by tvrdileep; 07-11-2003 at 02:47 AM.

  9. #9
    Join Date
    Jul 2001
    Location
    Slovenia
    Posts
    422
    Do you have MTS?
    There is a document about this on meatlink
    Tomaž
    "A common mistake that people make when trying to design something completely
    foolproof is to underestimate the ingenuity of complete fools" - Douglas Adams

  10. #10
    Join Date
    Oct 2001
    Location
    Doha, Qatar
    Posts
    103
    Hai Tomazz. The databse is running in MTS mode. Also, I don't have any access to metalinks as I'm not registered with them.
    Is MTS any cause for that? If you can send the documents on MTS that can help me out I will be very much thankful to you. Please help me in this issue. You can mail me at tvrdileep@rediffmail.com

Posting Permissions

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


Click Here to Expand Forum to Full Width