|
|
|
1000 Java Tips ebook
|
|
 

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java
programming articles and tips. Please take your copy here.
Take your copy of free "Java Technology Screensaver"!. |
|
Easy Learn Java: Programming Articles, Examples and Tips - Page 58
Previous
1060 Stories (530 Pages, 2 Per Page)
Next
How can I in Java convert this string 23AB to its hexadecimal representation 323
|
Question: How can in Java I convert this string
23AB to its hexadecimal representation 32334142.
Is there any method that can do that easily?
Or how could I write this function?
Answer: It is easy indeed:
Use parsing functions form Java API's class Integer...
Integer.parseInt(String s, int radix)
(for hexadecimal radix=16)
and
Integer.toHexString(int i).
It is good idea to add NumberFormatException handling
3 comments | | Score: 3.33
|
Posted by jalex on Thursday, July 03, 2003 (00:00:00) (12222 reads)
|
I have a binary flat-file database that I need to access via JDBC. How do I crea
|
Question: I have a binary flat-file
database that I need to access via JDBC. How do I create a driver that I can
use?
Answer: Read SUN's specifications on
http://java.sun.com/products/jdbc/
As written there "the new JDBC API, it also provides access to other tabular
data sources, such as spreadsheets or flat files..."
Also take a look at RmiJdbc on:
http://www.objectweb.org/rmijdbc/index.html - open source software.
***************************************
Our older tips: March 22, 2001 - October 21, 2002
read here.
All published and not published on the site tips you can find
here
34 comments | | Score: 3.66
|
Posted by jalex on Wednesday, July 02, 2003 (06:39:48) (6554 reads)
|
|
|