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

Postgresql – Specifying multiple addresses to postgres DB via JDBC driver

When connecting to postgres via psql I connect via: psql 'postgresql://[email protected]:5432,pg-clienthttpfile-dev3.dev-dc2-c1.gb.app:5432/clienthttpfile?connect_timeout=5&target_session_attrs=read-write' I'm trying to connect my app via the JDBC driver and the connection string above does not work: I tried with double and single quotes database.url="jdbc:postgresql://[email protected]:5432,pg-clienthttpfile-dev3.dev-dc2-c1.gb.app:5432/clienthttpfile?connect_timeout=5&target_session_attrs=read-write" database.url='jdbc:postgresql://[email protected]:5432,pg-clienthttpfile-dev3.dev-dc2-c1.gb.app:5432/clienthttpfile?connect_timeout=5&target_session_attrs=read-write' Both throw:…

VIEW QUESTION

Postgresql – Postgres error – invalid value for parameter "TimeZone": "CST"

Facing below error while running app from the cloud however this error is not getting when running from the local. Caused by: java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30000ms. at com.zaxxer.hikari.pool.HikariPool.createTimeoutException(HikariPool.java:695) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:197) at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:162)…

VIEW QUESTION
Back To Top
Search