Get IP address of the machine
Hello Experts,
I am writing one program, in my program i want whenever it runs on any machine i got the IP adress of that machine in my program output,
Is it possible with which function i can get the IP address of the machine...........
Please revert back me soon........
Pls check the forum you may get.
I checked and found this link
Re: BAPI for MB1B/MB1A - Goods Movement 555 and 344
You may get more examples
Regards
MD
Similar Messages
-
Get ip address of client machine and server
Respected experts,
I want to get ip address of the client machin and server machine.
Which method should i use for getting this.drvijayy2k2 wrote:
hi
i am not sure
but try request / servletrequest -> getRemoteHost() and getLocalHost()There isn't any getLocalHost() method for HTTPServletRequest. And in anycase, the getXXXHost() methods would return the hostname. You'll only get an IP address if the name cannot be resolved.
@OP:
[getRemoteAddr()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getRemoteAddr()] - be warned that this may be the IP address of the last proxy in the chain
[getLocalAddr()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getLocalAddr()] - this is the address of the interface that the request came in on, so for a server with multiple NICs, you will only be getting one possible IP address. -
Getting the MAC address of the machine
Is there any method to get the MAC address of machine in java.?????????????
In our proxy server application we get the IP address of each client connected our proxy server.
But as the IP addresses are dynamic , we can't trace the location of the machine whenever any client does malicious downloads.Thanks It works .
The code is as follows .
It works when the machine is connected to internet while throws a null pointer exception when not connected .
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
public class MacAddress {
public static void main(String[] args) throws SocketException, UnknownHostException {
try {
InetAddress address = InetAddress.getLocalHost();
* Get NetworkInterface for the current host and then read the
* hardware address.
NetworkInterface ni = NetworkInterface.getByInetAddress(address);
byte[] mac = ni.getHardwareAddress();
* Extract each array of mac address and convert it to hexa with the
* following format 08-00-27-DC-4A-9E.
for (int i = 0; i < mac.length; i++) {
System.out.format("%02X%s", mac, (i < mac.length - 1) ? "-" : "");
// System.out.print(mac);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (SocketException e) {
e.printStackTrace(); -
How to get MAC address from client machine ?
Hi dear,
We are implementing security measures for a banking system, so it is required that we track the MAC address of the registered clients along with other parameters. How do we get the MAC address from client machine using ADF or running scripts in client side?
thanks allHi,
Welcome to OTN.
Your question has nothing to do with ADF as such. Googling would give you plenty of such topics.
-Arun -
How to get IP-Address of the database
Hi,
I need to get the IP address of the database (MSSQL7.0) , that connects to my application . There are two ways to be connected: via DSN(jdbc:odbc:dsnName) or directly (jdbc:odbc:host:port). How can I get (both cases) the IP address of server I connected to.
CheersHi,
You could try connecting and then typing netstat -a at the DOS command prompt. This should show all open connections etc.
best,
kev -
How to get IP address of the Managed Server, in a cluster?
Hello,
I have created a cluster and have two managed servers in it. WLS version is 10.3 and paltform is Windows. Both the managed servers are on different machines. And I have Sun one web server (version 6) configured instead of the WLS in-built web server. I want to display, in my JSP, the IP/host name of the managed server to which the request is going to (forwarded by the Sun one server). How do I do that?
Any help would be greatly appreciated. Thanks in advace.
Thanks,
SanjayThere isint a way to get this which is weblogic specific.
you can try the following code to get it
import java.util.*;
import java.lang.*;
import java.net.*;
public class GetOwnIP
public static void main(String args[]) {
try{
InetAddress ownIP=InetAddress.getLocalHost();
System.out.println("IP of my system is := "+ownIP.getHostAddress());
System.out.println("hostname = " + ownIP.getHostName());
}catch (Exception e){
System.out.println("Exception caught ="+e.getMessage());
Hope this works -
Network stream get IP address of the other side
Hello
If I wire the reader url (computer A) input of the Writer Endpoint function in computer B, the Network Stream will run. Then how can I get the IP address of computer B in computer A.
Thanks.or just use the host name as part of the URL.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Get Server Address in the cluster
I want to get all the servers IP's participating in my cluster.
Is there a way to do it?
(I tried to use ClusterMBean APIs but it returns only the server names)
Thanks.
Pls find the attached code snippet.
Kumar
Shiri G wrote:
> I want to get all the servers IP's participating in my cluster.
> Is there a way to do it?
> (I tried to use ClusterMBean APIs but it returns only the server names)
>
> Thanks.
>
import java.util.Set;
import java.util.Iterator;
import java.rmi.RemoteException;
import javax.naming.*;
import weblogic.jndi.Environment;
import weblogic.management.MBeanHome;
import javax.management.ObjectName;
import weblogic.management.WebLogicMBean;
import weblogic.management.configuration.ServerMBean;
import weblogic.management.configuration.ClusterMBean;
import weblogic.management.WebLogicObjectName;
import weblogic.management.MBeanHome;
public class getServersInCluster {
static final int MAX_SERVERS_IN_CLUSTER = 10;
public static void main(String[] args) {
MBeanHome home = null;
//url of the Admin server
String url = "t3://172.17.240.99:8001";
String username = "system";
String password = "weblogic";
ClusterMBean clusterMBean = null;
Set mbeanSet = null;
Iterator mbeanIterator = null;
ServerMBean[] serverMbeanArray = new ServerMBean[MAX_SERVERS_IN_CLUSTER];
String clusterName = "MyCluster"; // name of your cluster
try {
Environment env = new Environment();
env.setProviderUrl(url);
env.setSecurityPrincipal(username);
env.setSecurityCredentials(password);
Context ctx = env.getInitialContext();
home = (MBeanHome) ctx.lookup("weblogic.management.adminhome");
} catch (Exception e) {
System.out.println("Exception caught: " + e);
try {
mbeanSet = home.getMBeansByType("Cluster");
mbeanIterator = mbeanSet.iterator();
while(mbeanIterator.hasNext()) {
clusterMBean = (ClusterMBean)mbeanIterator.next();
if(clusterMBean.getName().equals(clusterName)) {
System.out.println("Name: " + clusterMBean.getName());
serverMbeanArray = clusterMBean.getServers();
} catch (Exception e) {
System.out.println("Caught exception: " + e);
System.out.println("The servers in the cluster: " + clusterName + " are: " );
for (int i=0; i < serverMbeanArray.length; i++) {
System.out.println("\n\nserver " + i + " : " + serverMbeanArray.getName());
System.out.println("ListenAddress: " + serverMbeanArray[i].getListenAddress() + " ListenPort: " + serverMbeanArray[i].getListenPort()); -
How to get IP address of the client?
Hi,
I use the SAP Portal 6 SP2. I need to prevent user from accessing to iview depending of their IP. How can I get the IP of the users? What would the best practice in this case to personalize the iview depending of the IP?
Thank you,
MariaHI,
Use the below without Proxy detection:
<%
String ipaddress = request.getRemoteAddr();
%>
with Proxy detection:
<%
if (request.getHeader("HTTP_X_FORWARDED_FOR") == null) {
String ipaddress = request.getRemoteAddr();
} else {
String ipaddress = request.getHeader("HTTP_X_FORWARDED_FOR");
%>
Regards,
Birla. -
Getting IP address of machine in when-new-for-instance trigger
Hi,
I want to get IP address of the machine which is going to use fmx file. sys_context does not work. Please help me to solve this problem.
ThanksHi,
Did you get any error while using that in WNFI trigger? Add this to your when-new-form-instance trigger and see if you are getting the message with the IP address,
declare
v_ip varchar2(20);
begin
v_ip :=SYS_CONTEXT('USERENV','IP_ADDRESS');
message('IP Address : ' ||v_ip);
message(' ');
end;If you get any error, post the error.
-Arun -
How to get the IP address of the Client machine???
Hi All,
I am trying to get the IP address of the Client machine and using the code
SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM DUAL;
but this query only return server ip address but i want Client machine IP .
How can I get that. Please help.SowmyRaj wrote:
Hi All,
I am trying to get the IP address of the Client machine and using the code
SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM DUAL;
but this query only return server ip address but i want Client machine IP .
How can I get that. Please help.Which client's IP addess?
SYS_CONTEXT('USERENV','IP_ADDRESS') should give you the IP address of the machine from which the client is connected. So you are running sqlplus from Server?
To check other session's information, you can check V$SESSION view. -
How to get IPAddress of the Machine
Hi All,
Could anyone please tell me how to get the IP Address of the machine. Ie, I want to get my machine's IP Address and initialise the ServerSocket with that IPAddress. Thanks in Advance.
Regards,
Shankar.You find static methods for this in class java.net.InetAddress.
import java.net.InetAddress;
InetAddress myLocalIp = InetAddress.getLocalHost();If you have just one Network-card in you machine thats all you need to know, and as was stated in the previous post you don't need to initialise the ServerSocket with it beause the localhost-ip is used automaticly
If you on the other hand have more than one Network-card, or if you have any other open Network channels (like for instance your connected to the Internet via a modem you could use the following code-fragment to get all the available InetAddress-objects of you machine:
InetAddress local_ip=null;
InetAddress [] all_local_ips=null;
try {
//First retrieve your local hostname
local_ip=InetAddress.getLocalHost();
//now use you local hostname to get an array of all the IP's avaliable for you machine
all_locals_ips=InetAddress.getAllByName(local_ip.getHostName());
catch(UnknownHostException uhe) {
//Don't know my own names;
all_local_ips=null;
catch(SecurityException se) {
//Not allowed to read the names
all_locals=null;
} -
How to get the ip address of the host computer
Hi all,
How do I get the Internet IP Address of the Machine that has the Oracle HTTP Server?
Thanks.
Allen
Edited by: A.Sandiego on Sep 12, 2008 6:52 PMHello,
Do you mean the internal IP address or the IP address as seen by remote machines?
If you mean the internal IP address, then you can use -
OWA_UTIL.GET_CGI_ENV('SERVER_NAME');If you mean the internet accessible IP, then that's another kettle of fish, as due to your traffic routing etc, the server itself might not necessarily know that address, so if you really need to know it then you'd need to write a process that contacted a site like whatsmyip.org and parsed the output to find out the public IP address of that machine.
It really depends what you're trying to find really?
John.
http://jes.blogs.shellprompt.net
http://www.apex-evangelists.com -
IP address of the client machine ???
I want to know how to get the IP address of the user who has logged in from a client machine through Oracle forms. Does anyone how to get it from Oracle forms.
In fact i tried Sys_context (function) which returned the IP address of the client machine through SQL plus.
Select SYS_CONTEXT('USERENV','IP_ADDRESS') From Dual;
For testing sake, created a custom server side function using sys_context. From Oracle forms called the sever side custom function. During run time (from client machine), i got the IP address of the server (application server/DB server/forms server all in one NT box),not the IP address of the client machine.
Any ideas, welcome.
Thanks in advance
Sai
[email protected]
nullSowmyRaj wrote:
Hi All,
I am trying to get the IP address of the Client machine and using the code
SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM DUAL;
but this query only return server ip address but i want Client machine IP .
How can I get that. Please help.Which client's IP addess?
SYS_CONTEXT('USERENV','IP_ADDRESS') should give you the IP address of the machine from which the client is connected. So you are running sqlplus from Server?
To check other session's information, you can check V$SESSION view. -
Changing the ip address of the local machine through java program
Hi all,
I want to change the ip address of the machine in windows and linux through java program. Iam not aware that wheather this is possible or not. If possible pls help me.
Regards
BhaskarI'm always surprised by the weird things that developers find they need to do!
Maybe you are looking for
-
good day. as I can do to update my iphone 4 to the latest version of ios 5. whenever you connect to the pc and try to update the waiting time is very long, sometimes up to 12 hours and despite the wait always produce an error message for a long time
-
How do I get rid of the SPAM Popup Ad for an External HDD
A spam popup ad for an external HDD came down with supposed Lenovo system updates. This ad pops up every few hours and I can figure out how to get rid of it. There is a check box that says 'don't show again' but I check it and it doesn't work. I a
-
IBook G4 keyboard (option key?)
Hello: I seem to have this very strange problem while typing on my iBook G4. Regardless of the application, as I am typing I get weird charecters which exactly resemble that of using the option key. I do use this key, for example, accents in peoples
-
Program won't export photos to desktop......
This is more than annoying. I really liked iPhoto 06 better, as I could simply drag & drop from an actual folder on the hard drive to anywhere else on the computer. Now this version changed everything & basic functions are gone. The program is tellin
-
Voice chat hics up during screensharing
Hi all, since I did not find a special section for Messages, I post this question here. I am running a Mac Pro with Mountain Lion an Messages, my colleagues run 27" IMacs with Lion and IChat. When we share the screen it randomly happens that our voic