Questions tagged [jdbc-postgres]

jbdc-postgres is the JBDC (Java Database Connectivity) driver for the PostgreSQL database system.

JDBC is a core API of Java 1.1 and later. It provides a standard set of interfaces to SQL-compliant databases.

PostgreSQL is an open source object-relational database system.

Helpful links:

See also

48 questions
8
votes
1 answer

Play framework 2, postgres "This connection has been closed"

I'm running a Play 2.2.0 app, using Postgres 9.2-1002-jdbc4, and the Anorm 2.2.0 API. Every so often I have connection issues which look like: 2013-11-19 19:45:36,544 [ERROR][a.d.Dispatcher][play-akka.actor.default-dispatcher-17] This connection…
seand
  • 5,168
  • 1
  • 24
  • 37
8
votes
3 answers

How do I log postgres driver messages with slf4j?

I'm using postgres db in my webapp. I added following dependencies in my pom.xml: org.slf4j slf4j-api 1.7.5
Kerb
  • 1,138
  • 2
  • 20
  • 39
8
votes
0 answers

Change PostgreSQL current database from java

Is there any way to change postgreSQL current database from java application? or is there any equivalent for \connect report ? I know i can do this by changing JDBC connection string, but is there any better alternative?
MoienGK
  • 4,544
  • 11
  • 58
  • 92
5
votes
0 answers

no postgresql user name specified in startup packet

public class HelloPostgreSQLActivity extends Activity { TextView resultArea; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); resultArea = new TextView(this); …
Yashwanth
  • 880
  • 3
  • 13
  • 21
3
votes
2 answers

Query runs faster with EXPLAIN ANALYZE using parallel plan. Slows down and loses parallel workers without EXPLAIN ANALYZE. Postgres with DBeaver JDBC

I'm really puzzled by the following query: explain analyze (with z as ( select 1 as attraction ,1 as nd_attraction , n.fc from (select pe_id,zo_id,co_id,value_num as dt from rtpezocoav x --use view?? where…
3
votes
1 answer

Why does Hibernate execute select currval in persist occasionally?

Sometimes and seems randomly Hibernate executes query like that during persist operation: select currval('MY_TABLE_NAME_id_seq'); Entity: @Entity @Table(name = "MY_TABLE_NAME") public class MyEntity { @Id @Column(name = "ID", unique = true,…
H.Ç.T
  • 3,335
  • 1
  • 18
  • 37
3
votes
1 answer

How do I insert a JPEG image into a PostgreSQL bytea field using Java and then display on a website using PHP?

I made a little Java program that reads image files (jpg/jpeg) and inserts them into a database table covers.cover, which is of type bytea. I'm fairly certain that the byte[] cover parameter that is passed to the Java addCover(int riddim_id, byte[]…
phew
  • 808
  • 1
  • 15
  • 34
3
votes
0 answers

How to read/write a boolean array in a Postgres database?

I have a postgres DB containing a table with a boolean array for the days of the week (t/f whether the employee has to work on this day or not). The table is as follows: CREATE TABLE employee( ..., weekdays BOOLEAN[7], ... ); In…
t7bdh3hdhb
  • 438
  • 3
  • 15
3
votes
1 answer

Postgresql jdbc driver vs EDB driver

What's difference between Postgresql driver and EnterpriseDB driver for Postgresql. It seems like the former doesn't support procedures and the later supports it. Anybody messed with executing callable statement with both the drivers ?
Stunner
  • 961
  • 2
  • 19
  • 39
2
votes
1 answer

Violation of Foreign Key constraint in "task_metadata_fk" when launching a Task in SCDF Dashboard

I am trying to launch a task using the SCDF Dashboard. I am using CockroachDB as the underlying persistence layer with Hibernate ORM version 5.4.22.Final which is supported by the 2.7.0 release of SCDF as well as 2.8.0-SNAPSHOT. I am able to create…
2
votes
1 answer

Migrate PostgreSQL text/bytea column to large object?

I've got a table (10k rows) that stores large values in a text column. The current largest is 417 MB uncompressed (85 MB toasted). The flaw in this design is that it's not possible to stream these values (e.g. over JDBC) - anything using this column…
OrangeDog
  • 36,653
  • 12
  • 122
  • 207
2
votes
2 answers

Translating HQL Query to executable SQL Query with list parameter

I am writing a util function to get the total record count based on any HQL that I get passed in without loading all data. The passed in HQL might be pretty complex with lots of selects, joins, where conditions, groupings and sortings. For that I…
PMcL
  • 21
  • 4
2
votes
1 answer

why hibernate on oracle jdbc fails when postgre driver is present in tomcat lib folder

I've installed in the same Tomcat7 alfresco and some of my applications that use hibernate. In the lib folder I've ojdbc7.jar (for my apps) and postgresql-9.3-1100.jdbc41.jar for alfresco. Adding the postgre jdbc driver causes error in hibernate…
2
votes
1 answer

java.lang.IllegalStateException: Pool not open

while handling large Db transaction I encountered the following problem : java.lang.IllegalStateException: Pool not open at org.apache.commons.pool.BaseObjectPool.assertOpen(BaseObjectPool.java:78) at…
Nilesh
  • 133
  • 3
  • 10
2
votes
0 answers

Does Postgres' JDBC driver cache getAutoCommit()?

Does Postgres' JDBC driver cache the results of getAutoCommit()? Per Glassfish 3's docs, I need to know this to determine if I can use auto-commit as my connection-validation-method (versus something else like table and having to pick a…
Steve Kehlet
  • 6,156
  • 5
  • 39
  • 40
1
2 3 4