Optimization and modification of Oracle

yang qidong
This commit is contained in:
yanggang 2018-12-11 10:52:34 +08:00
parent 04b8992a89
commit bcd658bb11
3 changed files with 4 additions and 7 deletions

View File

@ -170,11 +170,7 @@
<artifactId>ojdbc</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>jdbc_oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>5.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.flume/flume-ng-core -->
<dependency>

View File

@ -50,8 +50,9 @@ class JdbcReadFromOracle extends ConfigurableStop{
val filedNames: Array[String] = schame.split(",")
var rowsArr:ArrayBuffer[ArrayBuffer[Any]]=ArrayBuffer()
while (rs.next()){
var rowArr:ArrayBuffer[Any]=ArrayBuffer()
while (rs.next()){
rowArr.clear()
for(fileName <- filedNames){
val name_type: Array[String] = fileName.split("\\.")
val name: String = name_type(0)

View File

@ -26,7 +26,7 @@ class JdbcWriteToOracle extends ConfigurableStop{
val inDF: DataFrame = in.read()
Class.forName("oracle.jdbc.driver.OracleDriver")
val con: Connection = DriverManager.getConnection("jdbc:oracle:thin:@10.0.86.237:1521/newdb","my","bigdata")
val con: Connection = DriverManager.getConnection(url,user,password)
val star: Statement = con.createStatement()
val fileNames: Array[String] = inDF.columns