JavaFAQ Home » Java Newsletters
[ The Java FAQ Daily Tips, weekly publication ]
Foreword: Excuse me for
possible mistakes. English is not native language for me.
In this issue:
Hello dear friends!
When I use InetAddress.getByName if a lookup to the name service failed then all
subsequent lookups of that hostname fail as well for the lifetime of the virtual
It looks like negative lookups are cashed. What is solution? Is it
more bugs I should be aware of?
Use latest J2SE 1.4! Prior to J2SE 1.4 negative lookups were always cached. This
has changed in 1.4 so that by default if a lookup fails it's possible for a
subsequent lookup to succeed. This is particularly important in dial-up
environments or environments where the name service is not reliable.
Also prior to J2SE 1.4.1 the java.net.InetAddress.getLocalHost() would
cache the lookup of the IP address of the local machine for the entire session
of the application. This behavior poses a problem for applications running on
machines that are connected to the internet via a dial-up connection or machines
that acquired their addresses through DHCP. This has been corrected in 1.4.1 so
that the local IP address is no longer cached. InetAddress.getLocalHost() will
return the correct IP address for dial-up connections as well as for
Prior to J2SE 1.4 the InetAddress.toString() would perform a lookup
via the name service if the hostname wasn't previously resolved. This is no
longer the case in 1.4 and toString will return immediately. If the hostname is
not resolved the returned string will contain the dotted IP address only.
Applications that depend on toString() returning a string with the resolved
hostname should be aware of this correction in 1.4
Java wimps please close your ears ... For the Java
thought he knew everything there was to know about Java, have
look at the most advanced Java newsletter archived on the website
what, it won't even cost you
anything! Subscribe today - you won't be
Question: In Ukraine first day of week is Monday but
By defaults in the calendar object obtained with locale ua_UA
() function return SUNDAY as a first week day... Java
version is 1.3.1_01
Answer: Yes indeed,
according to this list:
first day in Ukraine is Monday. For those who does not know will say that in
many countries Sunday or even Saturday is first day, for example in Egypt -
Saturday and in Argentina and Brasil - Sunday...
It was a bug since according
to ISO 8601 in all European countries a week starts with Monday...
that with Hungarian calendar was the same bug... In latest 1.4.1 and beyond the
bug is fixed.
to know: Performance testing has shown that the finalize methods in
the channel classes impose a significant GC penalty upon server-type programs
that must deal with
thousands of new open channels per second.
And now in J2SE 1.4.2the
finalize methods of the primitive channel classes (SocketChannel,
ServerSocketChannel, etc.) have been removed . Additional performance test
measurements revealed that the presence of these methods imposed a significant
(factor of 100) garbage-collection penalty upon server-type applications that
process thousands of new open channels per second. User code that deals in
channels should be carefully written to close channels explicitly rather than
rely upon the garbage collector to do so.
Latest posts on our
|Trying to connect to mysql!?
I´m trying to connect to a
mysql database from a applet, but I get this error:
Unable to connect to
any hosts due to an exception:java.security.AccessControlException:access
denied.....and so on.
What´s that? It used to work in postgres.
should I do?
I have a java menu, and
also java visual effects on our logo. at http://www.blueislanddivers.com/testlogo.htm but cannot make
the menu bar remain on top view over the logo. I'm more of a 'mechanic' than
programmer, certainly not an expert. Any help would be greatly appreciated.
|Connect 4 or 4 in a Row HELP
a school project, the game connect 4, or four in a row. I have everything done,
except for where the program checks wether the
lines are 4 in a row or
not. Can anyone help? Here's the code:
I can't run one applet with a
menu, where itemmenu don't call the function related.
The same menu in
the application fashion work, please help me and sorry for mi english
I would like to send me (or
give links) of java code
relative to :
sorting an array of integers in
|Almost no hair left! NullPointerException in
I get this error after app has
been running a while.
What is the problem and where can I fix? It doesn't
happen on my dev machine, but only on the production system.
Help will be
Printer Friendly Page
Send to a Friend
Search here again if you need more info!