45
45
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORETYPE_PROPERTY
46
46
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_TRUSTSTORE_PROPERTY
47
47
from wlsdeploy .aliases .model_constants import DRIVER_PARAMS_USER_PROPERTY
48
+ from wlsdeploy .aliases .model_constants import JDBC_DRIVER_PARAMS
48
49
from wlsdeploy .aliases .model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
50
+ from wlsdeploy .aliases .model_constants import JDBC_RESOURCE
49
51
from wlsdeploy .aliases .model_constants import JDBC_SYSTEM_RESOURCE
50
52
from wlsdeploy .aliases .model_constants import PASSWORD_ENCRYPTED
51
53
from wlsdeploy .aliases .model_constants import RCU_COMP_INFO
@@ -228,9 +230,9 @@ def __precheck_rcu_connectivity(self):
228
230
self .__logger .entering (class_name = self .__class_name , method_name = _method_name )
229
231
230
232
domain_typename = self ._model_context .get_domain_typedef ().get_domain_type ()
233
+
231
234
rcu_prefix = self ._rcu_db_info .get_rcu_prefix ()
232
235
schema_name = None
233
-
234
236
user_name = None
235
237
if not string_utils .is_empty (rcu_prefix ):
236
238
user_name = self ._model_context .get_weblogic_helper ().get_stb_user_name (rcu_prefix )
@@ -264,6 +266,10 @@ def __precheck_rcu_connectivity(self):
264
266
props .put ('user' , user_name )
265
267
props .put ('password' , rcu_schema_pwd )
266
268
269
+ # Pick up any values overridden by any model resources section overrides for the STB datasource.
270
+ jdbc_driver_name , jdbc_conn_string = \
271
+ self .__update_precheck_from_model_data_source (jdbc_driver_name , jdbc_conn_string , props )
272
+
267
273
# Force the driver to be loaded and registered...
268
274
JClass .forName (jdbc_driver_name )
269
275
DriverManager .getConnection (jdbc_conn_string , props )
@@ -839,3 +845,32 @@ def __get_jdbc_driver_class_name(self, rcu_database_type, is_xa=False):
839
845
840
846
self .__logger .exiting (class_name = self .__class_name , method_name = _method_name , result = driver_name )
841
847
return driver_name
848
+
849
+ def __update_precheck_from_model_data_source (self , jdbc_driver_name , jdbc_conn_string , props ):
850
+ _method_name = '__update_precheck_from_model_data_source'
851
+ self .__logger .entering (jdbc_driver_name , jdbc_conn_string ,
852
+ class_name = self .__class_name , method_name = _method_name )
853
+
854
+ model_resources_dict = self ._model_object .get_model_resources ()
855
+ data_source_name = self ._model_context .get_weblogic_helper ().get_jrf_service_table_datasource_name ()
856
+ data_sources_dict = dictionary_utils .get_dictionary_element (model_resources_dict , JDBC_SYSTEM_RESOURCE )
857
+ model_data_source_dict = dictionary_utils .get_dictionary_element (data_sources_dict , data_source_name )
858
+ model_jdbc_resource_dict = dictionary_utils .get_dictionary_element (model_data_source_dict , JDBC_RESOURCE )
859
+ model_driver_params_dict = dictionary_utils .get_dictionary_element (model_jdbc_resource_dict , JDBC_DRIVER_PARAMS )
860
+ model_properties_dict = \
861
+ dictionary_utils .get_dictionary_element (model_driver_params_dict , JDBC_DRIVER_PARAMS_PROPERTIES )
862
+
863
+ new_jdbc_driver_name = dictionary_utils .get_element (model_driver_params_dict , DRIVER_NAME , jdbc_driver_name )
864
+ new_jdbc_conn_string = dictionary_utils .get_element (model_driver_params_dict , URL , jdbc_conn_string )
865
+
866
+ new_password = dictionary_utils .get_element (model_driver_params_dict , PASSWORD_ENCRYPTED )
867
+ if new_password is not None :
868
+ new_password = self ._aliases .decrypt_password (new_password )
869
+ props .set ('password' , new_password )
870
+
871
+ for prop_key , prop_value in model_properties_dict .iteritems ():
872
+ props .set (prop_key , prop_value )
873
+
874
+ self .__logger .exiting (class_name = self .__class_name , method_name = _method_name ,
875
+ result = [new_jdbc_driver_name , new_jdbc_conn_string ])
876
+ return new_jdbc_driver_name , new_jdbc_conn_string
0 commit comments