在超图的数据源里oraclespatial和oracleplus两个类别数据源有区别,oracleplus数据源是超图的sdx引擎实现的;oraclespatial是oracle空间数据标准。其用法有写不一样:
oracleplus数据源的连接示例:
val params = new java.util.HashMap[String, java.io.Serializable]()
params.put(SDXFeatureRDDProviderParams.DBType.key, "OraclePlus")
params.put(SDXFeatureRDDProviderParams.Server.key, "127.0.0.1:1521/orcl")
params.put(SDXFeatureRDDProviderParams.User.key, "c##mytest")
params.put(SDXFeatureRDDProviderParams.PassWord.key, "supermap")
params.put(FeatureRDDProviderParams.ProviderType.key, "sdx")
val sdx = new SDXFeatureRDDProvider()
val rdd = sdx.rdd(new Configuration(), ss.sparkContext, params, new Query("NewPoint"))
oraclespatial数据源连接示例:
val params = new java.util.HashMap[String, java.io.Serializable]()
params.put(JDBCFeatureRDDProviderParams.DBType.key, "oracle")
params.put(JDBCFeatureRDDProviderParams.Host.key, "127.0.0.1")
params.put(JDBCFeatureRDDProviderParams.Port.key, 1521)
params.put(JDBCFeatureRDDProviderParams.Schema.key, "public")
params.put(JDBCFeatureRDDProviderParams.DataBase.key, "orcl")
params.put(JDBCFeatureRDDProviderParams.User.key, "aaa")
params.put(JDBCFeatureRDDProviderParams.PassWord.key, "aaa")
params.put(FeatureRDDProviderParams.ProviderType.key, "JDBC")
注意:连接oracle数据源依赖各节点的oracle客户端环境变量。