DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: What machine is this jdbc connection from ?

  1. #1
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316
    Here is what our developer uses to connect to the database:
    ----------------------------------------------------------
    s1 = "jdbcracle:" + args[3] + ":@" +
    "(description=(address=(host=" + host+
    ")(protocol=tcp)(port=" + port+
    "))(connect_data=(sid=" + sid +
    ")))";
    }

    DriverManager.registerDriver(
    new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection( s1,
    "scott",
    "tiger");
    -----------------------------------------------------------

    BUT, in v$session I only see the machine as "jdbcclient", and program as "JDBC Client 1.0" !

    Like other apps when they connect to the DB directly (not thru JDBC) I want to be able to see where they are connecting from and what program they are running.

    How is this possible ?
    Does any one know additional properties that can be passed thru DriverManager.getConnection when making the connection.

    Thanks in advance.

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Check the listener.log file in $ORACLE_HOME/netowork/log

    There you can find the host which is making the jdbc connection to the database. Take the IP address and do an nslookup, that will give you the name of the server that is making that connection.


    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316
    How about a way without going to the OS ?

    Does anyone know of any DriverManager.getConnection properties ?

  4. #4
    Join Date
    Jan 2002
    Posts
    26
    You can use lsof utlity on UNIX platforms.
    ftp://vic.cc.purdue.edu/pub/tools/unix/lsof

  5. #5
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316
    Don't have permissions to open the folder, since it is a ftp site; can you cut n paste the few lines, thanks.

  6. #6
    Join Date
    Jan 2002
    Posts
    26
    This can help you to find all open sockets on the machine and for particular PID,port ...
    Try use this site
    ftp://ftp.cerias.purdue.edu/pub/tool.../sysutils/lsof

  7. #7
    Join Date
    Sep 2000
    Location
    Chicago, IL
    Posts
    316
    Once again zdenekm, I did not have permission to open the folder at the ftp site !

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