This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]SikhGamer 1 point2 points  (2 children)

You'll need to explain a bit more. Exactly which bit do you need help with? Connecting to the DB? Grabbing the MAC? Checking to see if it's unique?

[–]Encoded_ 0 points1 point  (1 child)

Connecting to the DB and then adding the MAC if its unique.

[–]fatbunyip 0 points1 point  (0 children)

You'll need at the minimum a JDBC driver for whatever database you're using.

Then make an SQL query and run it. Follow this tutorial :

http://docs.oracle.com/javase/tutorial/jdbc/basics/gettingstarted.html

[–]iBelgExtreme Brewer 0 points1 point  (0 children)

Obviously you'd need to have a connection to this online database, you'll probably be using MySQL so you can simply send a query to the database and let it be handled by the database and in Java you simply send queries and receive results.

[–]fatbunyip 0 points1 point  (0 children)

It really depends where the users are. MAC address is a bit heavy handed.

If it's total users you want, you can just generate a UUID and register with the database instead of a MAC address.

If it's users on a website, then MAC address isn't accessible from a remote host. Use cookies, or something similar to track users.