Vivek Kr Singh

Ranch Hand
+ Follow
since Oct 12, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vivek Kr Singh

There is an API available for this exact functionality. Please see http://opencsv.sourceforge.net/#sql-integration
13 years ago
Yes. you need to explicitly add this in classpath of your project. Check http://commons.apache.org/dbcp/
14 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
15 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.
15 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

15 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.
15 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.

15 years ago

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


Is your rmiregistry running ?
15 years ago
Ubuntu .. Simple to use, Excellent Forums
15 years ago
You can check this link but his books are very expensive in India
15 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.