Commit d8696555 authored by Ajit Deshmukh's avatar Ajit Deshmukh

Made changes in the connection configuration. For the live SQL execution, the...

Made changes in the connection configuration. For the live SQL execution, the connection will be created with the DB_MAIN column value instead of the SCHEMA_NAME value.
parent 45838bd0
...@@ -960,7 +960,9 @@ public class ManageSqlConf extends ActionHandlerEJB { ...@@ -960,7 +960,9 @@ public class ManageSqlConf extends ActionHandlerEJB {
updateClosedDetailsPs.setString(2, tranIdRef); updateClosedDetailsPs.setString(2, tranIdRef);
int updateClosedDetailsCount = updateClosedDetailsPs.executeUpdate(); int updateClosedDetailsCount = updateClosedDetailsPs.executeUpdate();
BaseLogger.log("1", null, null, "updateClosedDetailsCount:: [" + updateClosedDetailsCount + "]"); BaseLogger.log("1", null, null, "updateClosedDetailsCount:: [" + updateClosedDetailsCount + "]");
if (updateClosedDetailsPs != null) {
updateClosedDetailsPs.close();
}
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -2369,7 +2371,7 @@ public class ManageSqlConf extends ActionHandlerEJB { ...@@ -2369,7 +2371,7 @@ public class ManageSqlConf extends ActionHandlerEJB {
+ schemaForPlaceHolder + "]"); + schemaForPlaceHolder + "]");
} }
if (schemaName.equalsIgnoreCase("APPVIS")) { if (schemaName.equalsIgnoreCase("APPVIS") || schemaName.equalsIgnoreCase("APPVISQC")) {
BaseLogger.log( BaseLogger.log(
"3", "3",
null, null,
...@@ -2406,7 +2408,10 @@ public class ManageSqlConf extends ActionHandlerEJB { ...@@ -2406,7 +2408,10 @@ public class ManageSqlConf extends ActionHandlerEJB {
System.out.println("execSchema:: " + execSchema); System.out.println("execSchema:: " + execSchema);
System.out.println("enterpriseCode:: " + enterpriseCode); System.out.println("enterpriseCode:: " + enterpriseCode);
//Comment out this part as for creating connection for Live schema does not need to use schema_name value instead use db_main value directly[26-June-2026]
// 1. Get the Connection String for the Main Execution // 1. Get the Connection String for the Main Execution
/*
String connForExecSql = "select schema_name from enterprise where enterprise = ?"; String connForExecSql = "select schema_name from enterprise where enterprise = ?";
PreparedStatement connForExecPstmt = conn.prepareStatement(connForExecSql); PreparedStatement connForExecPstmt = conn.prepareStatement(connForExecSql);
connForExecPstmt.setString(1, enterpriseCode); connForExecPstmt.setString(1, enterpriseCode);
...@@ -2417,10 +2422,9 @@ public class ManageSqlConf extends ActionHandlerEJB { ...@@ -2417,10 +2422,9 @@ public class ManageSqlConf extends ActionHandlerEJB {
+ connForExecRs.getString(1)); + connForExecRs.getString(1));
connForExec = connForExecRs.getString("schema_name"); connForExec = connForExecRs.getString("schema_name");
} }
*/
if (execRights.trim().equalsIgnoreCase("P") || execRights.trim().equalsIgnoreCase("C")) {
connForExec = schemaName; connForExec = schemaName;
}
System.out.println("connForExec:: " + connForExec); System.out.println("connForExec:: " + connForExec);
try { try {
...@@ -2594,10 +2598,10 @@ System.out.println( ...@@ -2594,10 +2598,10 @@ System.out.println(
tranId, enterpriseCode, linNo, requestID, tranId, enterpriseCode, linNo, requestID,
finalSql, updCount, "E", userId, chgTerm, error, dbMainSchema); finalSql, updCount, "E", userId, chgTerm, error, dbMainSchema);
} finally { } finally {
if (connForExecRs != null) // if (connForExecRs != null)
connForExecRs.close(); // connForExecRs.close();
if (connForExecPstmt != null) // if (connForExecPstmt != null)
connForExecPstmt.close(); // connForExecPstmt.close();
if (connForQueryExec != null) if (connForQueryExec != null)
connForQueryExec.close(); connForQueryExec.close();
if (conn != null) if (conn != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment