Quantcast
Channel: CodeSection,代码区,数据库(综合) - CodeSec
Viewing all articles
Browse latest Browse all 6262

使用geotools导入shp文件到Oracle数据库时表名带下划线问题的解决方法

$
0
0
问题:
最近在做利用geotools导入shp文件到Oracle表中,发现一个问题Oracle表名带下划线时导入失败,问题代码行: dsOracle.getFeatureWriterAppend(oracleTable, Transaction.AUTO_COMMIT); dsOracle为org.geotools.data.DataStore类型对象
解决方案:
网上查阅资料发现是Oracle11的java包ojdbc的版本问题,maven中搜索ojdbc发现最新版如下图
使用geotools导入shp文件到Oracle数据库时表名带下划线问题的解决方法
pom配置:

<!-- https://mvnrepository.com/artifact/ojdbc/ojdbc -->
<dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc</artifactId>
<version>14</version>
</dependency>
但是,Oracle11g的ojdbc最新版本应该是ojdbc6
使用geotools导入shp文件到Oracle数据库时表名带下划线问题的解决方法
pom配置:

<!-- https://mvnrepository.com/artifact/cn.guoyukun.jdbc/oracle-ojdbc6 -->
<dependency>
<groupId>cn.guoyukun.jdbc</groupId>
<artifactId>oracle-ojdbc6</artifactId>
<version>11.2.0.3.0</version>
</dependency>
所以我将ojdbc的jar包更新为oracle-ojdbc6-11.2.0.3.0.jar版本的就OK

Viewing all articles
Browse latest Browse all 6262

Trending Articles