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

45 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,044
  • 1
  • 21
  • 35
6
votes
4 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,089
  • 1
  • 19
  • 38
6
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,180
  • 9
  • 49
  • 89
4
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
  • 624
  • 2
  • 10
  • 20
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
  • 2,264
  • 1
  • 9
  • 26
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
  • 694
  • 1
  • 13
  • 31
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
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

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
  • 738
  • 1
  • 11
  • 33
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
  • 113
  • 1
  • 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
  • 5,577
  • 5
  • 34
  • 38
1
vote
1 answer

Socket is being closed on server before postgres returns result - c3p0

This only happens when the system is under load. At least it is noticable then. Postgres 8.3.14 JDK 1.6 Tomcat 6 Machine has 7GB of memory I've noticed my postgres data directory is eating up my entire hd as well. I have postgres on a 100GB drive…
kgibbon
  • 716
  • 1
  • 15
  • 37
1
vote
1 answer

PostgreSQL CopyManager copyIn appears stuck doing nothing when using it with COPY FROM STDIN

I am trying to use PostgreSQL CopyManager copyIn functionality with COPY FROM STDIN as suggested in the docs for very fast copying from an InputStream into a database table. I am thinking of using this to continuously stream rows that are to be…
lmk
  • 365
  • 2
  • 12
1
vote
1 answer

JDBCIO Calling Postgres Routine (Stored Proc) which takes a Custom Object Type as parameter

I'm trying to call a Postgres routine which takes a custom Object type as a parameter. create type person_type as ( first varchar, second varchar, is_real boolean ); My routine (stored proc): create function person_routine(person…
Chimmy
  • 117
  • 8
1
2 3