Exception in thread "main" org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'retail_db' not found;

Not able show hive databases on spark-submit, but able to show in spark-shell.
Please find the code below,

val warehouseLocation = new File("/apps/hive/warehouse/").getAbsolutePath
val spark = SparkSession
.builder()
.appName(PropertyUtils.getString(“app.name”)).master(executionMode)
.config(“spark.sql.shuffle.partitions”, 10)
.config(“spark.sql.warehouse.dir”, warehouseLocation)
.enableHiveSupport()
.getOrCreate()

spark.sql(“show databases”).show()

Above line is throwing below exception,
Exception in thread “main” org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database ‘retail_db’ not found;