Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find IP address by SQL Query

 
Amit Suresh Pawar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to know thqt, is there any query that find a IP address of the Current machine?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, what does SQL have to do with IP addresses? Are you storing those in a database?
 
Amit Suresh Pawar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.........
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want to do something like:

or does "current machine" mean something else?
 
Amit Suresh Pawar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would want to pass this information to JDBC so it could set it in the SQL update.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic