Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Vivek Kr Singh

Ranch Hand
+ Follow
since Oct 12, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vivek Kr Singh

There is an API available for this exact functionality. Please see http://opencsv.sourceforge.net/#sql-integration
10 years ago
Yes. you need to explicitly add this in classpath of your project. Check http://commons.apache.org/dbcp/
11 years ago
I am getting familiar serialization API's in JDK. I have a simple question regarding implementation of java.io.DataOutPutStream writeXXX operations.

Here is the implementation for this API


Why there is a bitwise & with 0xFF ?

Edit : out.write will only write a byte and bitwise & with 0xFF will return a byte
12 years ago
Since you are using Spring, you could probably write an Interceptor which checks if the system is ready to serve requests or not. You can also use a normal http filter to achieve the same.
12 years ago
Piece of code below is thread safe, so no need for synchronized block



Piece of code below is not thread safe as value can be modified by another thread when not using synchronized block

12 years ago
Use java.lang.AtomicInteger or java.lang.AtomicLong. Invoke incrementAndGet() to get new value for counter. No explicit synchronization needed. Don't store response value in a reference.
12 years ago
try using this on JDK 1.5

java.rmi.ConnectException: Connection refused to host: hostname; nested exception is:


You must be running server code on same machine on which RMI registry is running. Client code can be executed from any machine provided the skeleton is available.

12 years ago

at java.rmi.Naming.rebind(Unknown Source)
at com.example.rmi.MyRemoteImpl.main(MyRemoteImpl.java:38)


Is your rmiregistry running ?
12 years ago
Ubuntu .. Simple to use, Excellent Forums
12 years ago
You can check this link but his books are very expensive in India
12 years ago

Siva Masilamani wrote:Then could you please explain what they are trying to point out here

"with either fragment the first output must be Yo"


Dudes instance created in go() has no synchronization associated with it. There is absolutely no guarantee which thread will execute flag = id first even when using synchronized keyword. It could be any of the threads who enter the block first.