skip to Main Content

How to Insert `int[]` type data into Postgresql using jdbc? (wrong array used)

The wxvc_collection column data type is int[], t_hot_hub_operation_item is table name. fun main() { val connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/sage-dev", "postgres", "123456") val sql = "INSERT INTO t_hot_hub_operation_item (wxvc_collection) VALUES (?)" val statement = connection.prepareStatement(sql) val array = connection.createArrayOf("int4", arrayOf(listOf(1, 2, 3)))…

VIEW QUESTION
Back To Top
Search