aspose file tools*
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
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: 42594
    
  65
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: 42594
    
  65
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30910
    
158

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find IP address by SQL Query