Viji San wrote:Do we need to use synchronized in the below static method code in multi threaded environment ?...
Can't tell much about it with the given code, anyway if the data (used in this scenario) are being manipulated by multiple programs you should synchronize the access to those data.
It depends. You need to have some form of synchronization, but perhaps it's a better idea to do it in the database, perhaps with a stored procedure. That way your requests are thread safe even outside your Java program.
If you decide to do it in Java, don't synchronize this method. It will still be possible to execute the same query by calling DataBaseManager.getdb().executeQuery("GETSEQUENCE") directly.