sql = "select * from tablename"
user = ""
password = ""
server = ""
port =
service_name = ''
jdbcUrl = f"jdbc:oracle:thin:@{server}:{port}:{service_name}"
jdbcDriver = "oracle.jdbc.driver.OracleDriver"
DF = spark.read.format("jdbc") \
.option("url", jdbcUrl) \
.option("query", sql) \
.option("user", user) \
.option("password", password) \
.option("driver", jdbcDriver) \
.load()
by this you can make a connection with your oracle database and read files from the database and same you can write the data to particular database .
Rishabh Pandey