Forum Discussion

Ganeshu108's avatar
Ganeshu108
New Contributor II
3 years ago
Solved

Error:class java.util.ArrayList cannot be cast to class java.sql.Array

Hello ,
I am facing following issue while inserting data into postgres database from json file.

Error : class java.util.ArrayList cannot be cast to class java.sql.Array (java.util.ArrayList is in module java.base of loader ‘bootstrap’; java.sql.Array is in module java.sql of loader ‘platform’).

  • @ganesh1

    I guess that you should transform the JSON in flatten format (split any nested structures from the JSON) before you insert in PostgreSQL table.

    BR,
    Spiro Taleski

3 Replies

  • SpiroTaleski's avatar
    SpiroTaleski
    Valued Contributor

    @ganesh1

    I guess that you should transform the JSON in flatten format (split any nested structures from the JSON) before you insert in PostgreSQL table.

    BR,
    Spiro Taleski