我有一个Oracle DB坐在我们办公室的某些服务器中。它有Oracle 9i version
。
我正在尝试从AWS Glue
建立连接以连接到我的数据库。我添加了ojdbc14.jar
作为连接到Oracle 9i的依赖项。
这是我的胶水代码:
import sys
import boto3
import json
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.dynamicframe import DynamicFrame
from awsglue.job import Job
## @params: [JOB_NAME]
args = getResolvedOptions(sys.argv, ['JOB_NAME'])
sc = SparkContext()
glueContext = GlueContext(sc)
spark = glueContext.spark_session
job = Job(glueContext)
job.init(args['JOB_NAME'], args)
connection_oracle9_options = {
"url": "jdbc:oracle:thin:@//ip-address-of-db:1521/JDAPROD",
"dbtable": "ALDO.FT_BP_STRMO",
"user": "BI_READ",
"password": "SUN2DAY",
"customJdbcDriverS3Path": "s3://raw/Dependencies/ojdbc14.jar",
"customJdbcDriverClassName": "oracle.jdbc.OracleDriver"}
df_oracle11 = glueContext.create_dynamic_frame.from_options(connection_type="oracle", connection_options=connection_oracle9_options)
df_oracle11.show()
job.commit()
我想念什么吗?