wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to find IP address by SQL Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to find IP address by SQL Query" Watch "How to find IP address by SQL Query" New topic
Author

How to find IP address by SQL Query

Amit Suresh Pawar
Ranch Hand

Joined: Dec 09, 2008
Posts: 30
Hi All,

I want to know thqt, is there any query that find a IP address of the Current machine?


Amit S. Pawar
SCJP,SCWCD,OCA
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41049
    
  43
Umm, what does SQL have to do with IP addresses? Are you storing those in a database?


Ping & DNS - my free Android networking tools app
Amit Suresh Pawar
Ranch Hand

Joined: Dec 09, 2008
Posts: 30
yes.........
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41049
    
  43
So you have a table, and one of its attributes is an IP address. What are the other attributes that you can use to find any particular record? Is this a server application, and you're trying to find the record for the client IP? You really haven't provided enough information to help you.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

So you want to do something like:

or does "current machine" mean something else?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Amit Suresh Pawar
Ranch Hand

Joined: Dec 09, 2008
Posts: 30
No No No..........

Dear, I want to find the IP address of my machine that I'm current using, for auditing purpose.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

But SQL runs on the database server. So your only choice (if you want to run this on the database server) would be to use whatever admin session auditing views/procedures your particular database gives you.

Which database are you using? What is forcing you to use SQL?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

You would want to pass this information to JDBC so it could set it in the SQL update.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: How to find IP address by SQL Query
 
Similar Threads
RMI lookup
client IP address
Identifying the client PC
how to identify the systems which are connected in java
Applets - web application