使用产品:SuperMap iObjects for Spark(版本10.0.1)、IManager。操作系统:windows10 64位
目前 iObjects支持读取和写出的数据源分别有哪些呢,在IOjects文档中经测试的不是特别准确,没有明确说明支不支持写出数据到oracle等形式的存储。
在使用SuperMap iObjects for Spark时,读取shp、csv、udb等数据源,写入Supermap Imanager中创建的oracle数据库中。
使用一些可视化工具如DataGrip和IDEA可以连接到数据库。
在本地进行测试,代码和报错如下:
定义了oracle的数据参数,想要将空间数据写入到oracle。有以下报错。
Exception in thread "main" java.lang.RuntimeException: Could not find a SpatialRDDProvider to process the params. at com.supermap.bdt.FeatureRDDProviderFactory$$anonfun$createProvider$2.apply(FeatureRDDProviderFactory.scala:19) at com.supermap.bdt.FeatureRDDProviderFactory$$anonfun$createProvider$2.apply(FeatureRDDProviderFactory.scala:19) at scala.Option.getOrElse(Option.scala:121) at com.supermap.bdt.FeatureRDDProviderFactory$.createProvider(FeatureRDDProviderFactory.scala:19) at com.supermap.bdt.FeatureRDDProviderFactory$.apply(FeatureRDDProviderFactory.scala:14) at com.dist.bdt.load.ToOracle$.main(ToOracle.scala:40) at com.dist.bdt.load.ToOracle.main(ToOracle.scala)
//读取oracle数据报错如下
Exception in thread "main" java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:774)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at com.supermap.bdt.rddprovider.jdbc.OracleFeatureRDD.<init>(OracleFeatureRDD.scala:31)
at com.supermap.bdt.rddprovider.jdbc.OracleFeatureRDD$.apply(OracleFeatureRDD.scala:314)
at com.supermap.bdt.rddprovider.jdbc.OracleFeatureRDDProvider.rdd(OracleFeatureRDDProvider.scala:39)
at com.dist.bdt.load.readOracle$.main(readOracle.scala:31)
at com.dist.bdt.load.readOracle.main(readOracle.scala)
Caused by: oracle.net.ns.NetException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
at oracle.net.ns.NSProtocolNIO.negotiateConnection(NSProtocolNIO.java:271)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:317)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1438)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)
... 10 more