Hi All,
We can use, below code to create a function in SCALA to connect to Oracle Database and call this function on your main SCALA by passing the parameter.
Please be sure to install the necessary drivers - oracle JDBC pool drivers
def connJdbc
(oracleUser: String,oraclePassword: String,oracleURL: String):
java.sql.Connection = { val ods =
new OracleDataSource()
ods.setUser(oracleUser)
ods.setURL(oracleURL)
ods.setPassword(oraclePassword)
ods.getConnection() } } |
Thank For sharing Valuable Information
ReplyDeleteMsbi Online Course
Msbi Online Training