I got an error after running a scala script in a db2 powered spark-shell. I can't find much information about the error online and wanted to know if there was a way to do that.
I have tried executing the getNextException() method on the exception and it was not a recognized command.
I have tried running a part of the java code listed as an example at https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_tjvjdbue.html and similar values were not recognized.
scala> try {
| //Load data into necessary table
| loadNMCview.write.format("jdbc").option("url", s"${sf_url}").option("dbtable", "tableName").option("driver", "com.ibm.db2.jcc.DB2Driver").mode("append").save
| } catch(BatchUpdateException buex) {
| System.err.println("Contents of BatchUpdateException:")
| System.err.println(" Update counts: ")
| System.out.println(buex.getUpdateCounts())
| }
<console>:31: error: not found: value BatchUpdateException } catch(BatchUpdateException buex) { ^ <console>:34: error: not found: value buex System.out.println(buex.getUpdateCounts())
Code:
loadNMCview.write.format("jdbc").option("url", s"${sf_url}").option("dbtable", "schemaName.tableName").option("driver", "com.ibm.db2.jcc.DB2Driver").mode("append").save
Error:
20/07/06 13:37:20 WARN TaskSetManager: Lost task 0.0 in stage 0.0 (TID 0, edclhdpd138.bcbsfl.com, executor 2): com.ibm.db2.jcc.am.BatchUpdateException: [jcc][t4][102][10040][4.17.29] Batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements. ERRORCODE=-4229, SQLSTATE=null