7 Replies Latest reply: Feb 8, 2013 6:03 AM by Christian Erlinger RSS

    Getting Host Name From Forms 6i (deployed in 10g AS)

    848948
      Hi,

      I need to get the host name of client while launching my application. I am using forms6i. So I cannot use webutils.pll for the same. But in the below thread I have read that Webutil.pll has been modified to use with FORMS 6i also. Can anybody send me webutils.pll which can be used with Forms 6i

      Re: Converting to Webutil? 6i and 9i equivalents.

      Its an urgent requirement

      Any help is appreciated.

      Thanks
        • 1. Re: Getting Host Name From Forms 6i (deployed in 10g AS)
          Christian Erlinger
          If you don't need the whole webutil functionality it would be easier to write a simple java bean which returns the name of the client hostname.
          Something similar to this: http://stackoverflow.com/questions/5596788/get-hostname-of-local-machine
          Its an urgent requirement
          http://www.catb.org/esr/faqs/smart-questions.html#urgent

          cheers
          • 2. Re: Getting Host Name From Forms 6i (deployed in 10g AS)
            Paul M.
            I need to get the host name of client while launching my application. I am using forms6i. So I cannot use webutils.pll for the same.
            Is there a reason that you want to use webutil ? What's the database version ? Can't you use sys_context function ?
            • 3. Re: Getting Host Name From Forms 6i (deployed in 10g AS)
              848948
              Hi,

              I have tried sys_context and java class option already ..but in vain :(..
              Let me explain my problem in detail.

              My database server(Oracle 10g) is in HOSTA
              My appserver (Oracle 10g AS)resides in HOSTB
              And user launches the application from HOSTC

              My requirement is to get the host name of the user while he launches the application. ie HOSTC in this case.

              If I am trying with java.net.InetAddress.getLocalHost().getHostName(); I am getting the value HOSTA(Host name of Data base server)
              If I am trying with SYS_CONTEXT I am getting HOSTB(Host name of appserver)

              And my requirement is to get HOSTC !!!

              I have read that if Webutil_clientinfo.get_host_name is used I can get the host name of client machine. But since I am working with forms 6i , I can't use Webutil.

              please help me if you know any way to achieve the same in forms 6i
              • 4. Re: Getting Host Name From Forms 6i (deployed in 10g AS)
                Paul M.
                My database server(Oracle 10g) is in HOSTA
                My appserver (Oracle 10g AS)resides in HOSTB
                And user launches the application from HOSTC
                Then you're not using Forms 6i, but Forms 10g, maybe you're developing with Forms 6i. Can't you install Developer suite 10g ?
                • 5. Re: Getting Host Name From Forms 6i (deployed in 10g AS)
                  Christian Erlinger
                  I guess you are using this 10g version which is in reality a 9i version capable of running 6i forms in the web (maybe you should post a 4 digit version number instead a marketing label)
                  If I am trying with java.net.InetAddress.getLocalHost().getHostName(); I am getting the value HOSTA(Host name of Data base server)
                  Could it be that you are trying to do this within a Java Stored Procedure? Because otherwise there is no way that you are getting the Hostname of the database server with this Method.

                  cheers
                  • 6. Re: Getting Host Name From Forms 6i (deployed in 10g AS)
                    848948
                    Yes.. I have tried with java stored procedure. Is there any other way to achieve the same from middile tier using java

                    Thanks
                    • 7. Re: Getting Host Name From Forms 6i (deployed in 10g AS)
                      Christian Erlinger
                      A stored java procedure is executed on the database server; getHostName() will return the name of the host where it is executed. What you need is to execute code on the client, not on the middletier, and not on the database. A java bean is such a thing:

                      http://www.oracle.com/technetwork/developer-tools/forms/documentation/269054-130573.pdf

                      cheers