Aggiunto noCount ad inizializzazione connession DB
This commit is contained in:
@@ -13,6 +13,7 @@ import javax.annotation.PreDestroy;
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -61,6 +62,10 @@ public class DataSource {
|
||||
connection.setAutoCommit(false);
|
||||
|
||||
if (connectionModel.getConnectionType() == EmsRestConstants.DB_TYPE.MSSQL) {
|
||||
try (final PreparedStatement setNocountOn = connection.prepareStatement("SET NOCOUNT ON")) {
|
||||
boolean resultNoCount = setNocountOn.execute();
|
||||
}
|
||||
|
||||
HashMap<String, Object> resultSessionData = UtilityDB.executeSimpleQueryOnlyFirstRow(connection, "select @@spid AS session_id," +
|
||||
" user_name() AS [user_name]," +
|
||||
" suser_name() AS [suser_name]," +
|
||||
|
||||
Reference in New Issue
Block a user