ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm writing a manufacturing inventory system in Java, and - for the life of me - I can't figure out what it is I need to search for, or how to probe a network for a particular server type.
For the client installer, I'm trying to get it to probe the network for any SQL servers, but I have no idea where to even start with this.
If there's any thought about it, I'm not in school, and this isn't a homework help request.
TBH, the user will just have to know what they are connecting to. In today's world figuring this out for them could be quite hazardous to your user's career (and yours by extension) if you resort to TCP connection tests.
That would look malicious to an IDS and amounts to a port scan. If they have a zealous and competent security staff at the place, they'll be at your user's desk within a couple of minutes.
You could try listening for UDP broadcasts, but security conscious dbas will limit udp to the local database server subnet. You really don't want to broadcast your db server's heartbeat (or whatever) to the entire network. It's just not a good thing to do.
IMHO this is probably the last thing you should worry about and could do more harm than good.
Have a look at java.net package classes and look for Java networking librairies(for utilities such as ping, etc.)
For example when you telnet a mysql server : telnet somehost.com 3306, there is a mysql response string which you can read. The string contains the server name and version.
I'll definitely post my results when I get the chance to test it out; I figured I would have to use the java.net package, but I didn't know what on Earth I would do with it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.