PGJDBC is a Java driver for the Postgresql relational database management system.
Questions tagged [pg-jdbc]
35 questions
1
vote
1 answer
Java 9 JDBC setup
The problem
I'm currently working with Java 9 and its module system and want to connect to my PostgreSQL database via JDBC.
The problem is that I could not find any information on its setup with Java 9 and it's module system but only for Java 8 and…

ShadowDragon
- 2,238
- 5
- 20
- 32
1
vote
1 answer
Why does setNetworkTimeout cause a timeout exception on queries with function?
I have a connection to a PostgreSQL DB (using the PostgreSQL JDBC Driver), and I set the network timeout on it (using the setNetworkTimeout method), and there is something weird about it.
When I use the connection for simple queries like select *…

user3927415
- 415
- 4
- 18
1
vote
0 answers
Bug in PG JDBC driver - MONEY DB type (Bad value for type double)
I am working with the Postgres JDBC driver
(postgresql-42.2.5.jar) and PostgreSQL 10.6 RDBMS.
I have a result set, and 3 of its columns are of type money
(on the DB level). And I have a result set meta data object.
When the column type is money,…

peter.petrov
- 38,363
- 16
- 94
- 159
1
vote
2 answers
PGJDBC: could not receive data from client:
Dear StackOverFlowers,
I was trying event-driven LISTENER/NOTIFY on Postgres 9.6 (Windows 10).
I followed PGJDBC example given by Steve Taylor at https://www.openmakesoftware.com/postgresql-listen-notify-events-example/.
I started by downloading…

BB23850
- 109
- 1
- 11
1
vote
1 answer
PostgreSQL notify in loop
I have used the pgjdbc-ng for Postgresql listen and notify.
I'd like to perform notify in the loop.
My example code:
FOR idx IN 0..3 LOOP
PERFORM pg_notify('q_event','test');
END LOOP;
I expect this using listen:
test test test
But I just…

Bongousse
- 28
- 4
1
vote
1 answer
Mahout, PostgreSQL and connection pool
Using PostgreSQL as data source in Mahout 0.9, I keep getting
WARN org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel - You are not using ConnectionPoolDataSource. Make sure your DataSource pools connections to the database itself,…

There Are Four Lights
- 1,406
- 3
- 19
- 35
1
vote
0 answers
Is it possible to the read data from bytea type field using getBlob() method in postgresql9.2
I am using postgresql 9.2 and ,when I read the data from Bytea(used to store binary large object data in postgresql) field using getBlob() method but I'm getting the same error
Error: type bad value for long.
I know that I'm getting this error…

Krishna
- 795
- 2
- 7
- 24
0
votes
1 answer
How to stream large results sets from QuestDB to java application?
I have an issue with PG Driver in Java. Usually I need to stream around 50-60 million rows from db to my java application, however (internally) the PG Driver creates a lot of garbage and all the Garbage Collections slow down my application. The…

Bolek Ziobrowski
- 190
- 7
0
votes
0 answers
Added PostgreSQL JDBC in CLASSPATH, but I still get the error that no suitable driver is found
I'm learning how to connect Java to PostgreSQL, but doing almost everything manually so I learn the basics.
Here is my code
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import…

jachai.sotaro
- 13
- 5
0
votes
2 answers
How does IntelliJ IDEA store dependency on PostgreSQL JDBC with Maven without altering pom.xml file?
I created Maven project with IntelliJ IDEA, and followed this tutorial on how to connect PostgreSQL JDBC with Java. But, instead of changing pom.xml file, I went to Project Structure → Libraries, where I've added postgresql-42.6.0.jar.
Everything…

jachai.sotaro
- 13
- 5
0
votes
0 answers
pgjdbc query timeout tuning
Is there a way to "cut down" jdbc call (commit or statement execution) to Postgres after specific timeout with millisecond accuracy?
JDBC driver docs propose loginTimeout, socketTimeout, connectTimeout, cancelSignalTimeout, statement_timeout, yet…

mrmirg
- 53
- 6
0
votes
1 answer
SingleCertValidatingFactory not working with AWS RDS global-bundle.pem?
I want to use the https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem which is stored in my application jar i.e. using classpath. So I tried using the below jdbc…

Vishal
- 549
- 3
- 13
0
votes
3 answers
postgres database issues with encoding UTF-8
I have created a docker image with this command docker compose up -d
where I was able to load pgAdmin instance in http://localhost:5050/browser/
create a database and table in the same , credentials are working properly.
However when I start to run…

Kaleb Tisnado Flores
- 35
- 4
0
votes
1 answer
Is it possible to have hibernate generate update from values statements for postgresql?
Given a postgresql table
Table "public.test"
Column | Type | Modifiers
----------+-----------------------------+-----------
id | integer | not null
info | text …

singe3
- 2,065
- 4
- 30
- 48
0
votes
2 answers
pass unknown number of parameters to IN clause using JDBC and Postgres
My query looks like this, and performs well:
select *
from table t
where (t.one,t.two,t.three) in ( (11,12,13), (21,22,23) );
Now the number of these triplets within the in statement will vary, so I'm trying to do the following with JDBC:
String…

pablo
- 747
- 1
- 10
- 24