How to convert a BIGINT to a mac address string

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to convert a BIGINT to a mac address string

Tzvika Barenholz
Hi guys

I have a db column representing a MAC address of a network device.
It is a 6 byte number, so I store it as BIGINT.

now the standard way to show MAC addresses in the UI is like this :
i.e. hex values with bytes separated with :
I'm trying to create a select statement that will do this.
the problem is that the mod() function won't take the number as it is
too big for it (?) and I am at a loss how to slice up the multibyte
without it.

any thoughts?

p.s. I could have really used Long.toHexString but it is not static...

thx in advance

SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement *
Hsqldb-user mailing list
[hidden email]