Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to restrict my connection to specific databases only?

 
Jack Tauson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer to following code:



The output of the following statement : Therefore I wish to consider only these two IP addresses for opening connection on the following line: But since I have already defined, RemoteIPAddress array from 0 - 6 at the start, the connection is getting opened for all the IP address. Please advise how can I restrict myself to some specific IP addresses as discussed above.

For reference, here is my database schema:

http://sqlfiddle.com/#!2/8cce4

Thanks
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you even defining IP addresses in your Java code, if you intend to use only those IP addresses obtained from the SQL result?

It would seem that using "ipAddress" instead of "RemoteIPAddress[i]" in line 32 should do the trick. You also need to increment i appropriately.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic