3
votes
0answers
130 views

UPSERT in PostgreSQL using jOOQ

I am trying to perform an UPSERT in PostgreSQL using the jOOQ library. For doing this I am currently trying to implement the following SQL statement in jOOQ: http://stackoverflow.com/a/6527838 My ...
2
votes
0answers
67 views

Unable to write data to table with postgresql OID type

I'm facing very strange problem with storing data to OID columns on PostgreSQL. The app configuration is: Java OpenJDK 64-Bit 1.7 JBoss Seam 2.2.2.Final Hibernate 3.6.4.Final PostgreSQL 9.3 (with ...
2
votes
0answers
227 views

I am trying to save data in postgres table after reading from an excel file.While trying to commit,I get a casting error

Model Class package test1; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; @Entity @Table(name="employee_details") public ...
2
votes
0answers
80 views

Occasional “General error” Occurs on INSERT into POSTGRES Database from Java

I'm trying to insert a collection of data from Java into a Postgres database. Both the JVM and the database are 64-bit. Querying the database and viewing the output showed that the code correctly ...
2
votes
0answers
174 views

How to use PostgreSQL hstore/json with jdbctemplate

Is there a way to use PostgreSQL json/hstore with jdbctemplate? esp query support. for eg: hstore: INSERT INTO hstore_test (data) VALUES ('"key1"=>"value1", "key2"=>"value2", ...
2
votes
0answers
230 views

Duplicate values present in primary key column in postgresql

I have a table in which one of the columns is primary key and it is of data type citext. Many threads will update the table, they are properly synchronized. Those threads write the data in ...
1
vote
0answers
34 views

Tomcat connection pool & idle connections

We are developing a website using Tomcat 7 JDBC PostgreSQL 9.2 We've had some connection leaks and think we corrected them (the database no longer stops responding), but the behaviour of the ...
1
vote
0answers
27 views

jdbc connectTimeout vs jdbc loginTimeout

There is a requirement in our project to support 'jdbc timeout' feature for Postgres (Postgresql driver). we also support Microsoft SQL (JTDS driver) and MySQl (mysql driver). So i want to introduce ...
1
vote
0answers
16 views

NetBeans unable to find org.postgresql.ds.PGSimpleDataSource driver

I have glass fish installed and have set up a JDBC connection pool and resource like so (with the password hidden for obvious reasons!): <jdbc-connection-pool ...
1
vote
0answers
31 views

createTableIfNotExists error - relation alredy exist

In my backend: //create ConnectioSource private static final String DB_NAME = "development"; private ConnectionSource connectionSource; private String databaseUrl = ...
1
vote
0answers
29 views

Hibernate to Eclipselink, PostgreSQL and UUID

Here's what I had to write to get UUID working as a primary key, with full UUID types (on all ends) in hibernate. Since this relies on some Hibernate specific code, what would I have to do to convert ...
1
vote
0answers
17 views

How copy a file stored as largeobject in postgres?

I use postgres 9.3 as DB, Spring 4.0.6 and the postgresql-9.3-1101-jdbc41.jar driver. I have the code to store a File into DB with the LargeObjectManager. I have also the code to retrieve the data ...
1
vote
0answers
60 views

How force Hibernate create table with type Serial for primary Key

In my spring project, the field Id (used as primary key for my entity classes), have this annotations: @Id @Column(name = "id") @GeneratedValue(strategy=GenerationType.AUTO) private Integer id; But ...
1
vote
0answers
169 views

PostgreSQL and Hibernate JPA not working

I'm trying to use JPA in Wildfly (which uses Hibernate) with PostgreSQL. I turned on hibernate.show_sql so I can execute the same query in PgAdmin III. The query is this one (EDIT: issuemanager_sch is ...
1
vote
0answers
62 views

Java application server connection pooling for different databases on same server

I have several java application servers (glassfish 3.0) running different applications with each application requiring an unique postgresql database and thus a different connection pool for each ...
1
vote
0answers
152 views

saving xml datatype using jpa in PostgreSQL

I want to save an xml datatype using jpa in the database(Postgres entity), i have created a converter which read the data from the xml column and create a field from this data . the problem is that ...
1
vote
0answers
70 views

JOOQ statement with LATERAL not working (Postgresql)

The Problem I am trying to convert the following SQL statement to JOOQ: SELECT g.id, g.machine_id, xmin.min_trans_id, xmax.max_id FROM machine_location_move_events g , LATERAL ...
1
vote
0answers
177 views

PostgreSQL database doesn't connect

I'm creating a dynamic web project with eclipse and I want to use tomcat 7.0.50 and a postgresql database using a connection pool. I already copied the postgresql-9.2-1003.jdbc4.jar file in ...
1
vote
0answers
472 views

JPA 2.1 Entity graph's subgraphs generating empty joins

I am using a new feature in JPA 2.1 called Entity Graphs with QueryDSL. It's working great. But when I use subgraph, JPA generate invalid SQL. Here is my sample: @NamedEntityGraph( ...
1
vote
0answers
275 views

could not serialize access due to read/write dependencies among transactions

I managed in the end to reproduce the serialization problem in this SO question to an SSCCE (Shortest Self-Contained Complete Example). I am using the jdbc and java tags although I believe this is not ...
1
vote
0answers
40 views

Heroku can't find existing table

So I just pushed my application to Heroku and it seemed to work for the first hour, people were able to sign up for my service, however after the first hour, whenever someone hit sign up they were ...
1
vote
0answers
62 views

permission denied to access to database tomcat7

I'm working on Eclipse with Tomcat6 and I use PostgreSQL as database. I try to configure Tomcat6 on eclipse but it doesn't work. So I download a Tomca6 server. When I test my application I put my ...
1
vote
0answers
66 views

Hibernate deletes manyToMany relationship rows on fetch

I am using Hibernate4 with Spring and I am trying to map a Term class to a Document class. A term may occur in many documents and a document can contain many terms. I have read up on this, and I have ...
1
vote
0answers
96 views

spring-batch job throws “column reference is ambiguous”

I'm using spring batch in java. I have two tables table1 and table2 in my postgres db. first table have one column 'lid' and second table have lid and bid columns. my spring config looks like: ...
1
vote
0answers
138 views

How to deal with postgresql data types that Hibernate can not deserialize?

I recently started attempting to use hibernate to interact with my database. I was following a guide I found online to set it up and use it. https://netbeans.org/kb/docs/java/hibernate-java-se.html ...
1
vote
0answers
280 views

Mapping JSON String as Postgresql's JSON type with hibernate

How should I tell Hibernate to map a String containing a JSON value to PostgreSQL as PostgreSQL's JSON Type ? Assume I have an attribute like this: private String foo_json_value; I have used Gson ...
0
votes
0answers
20 views

Android and PGSQL database

One question, what IP/Host address should i use to connect to my PG database on my Android app? I have a postgresql database running on my machine. Im using eclipse by deploying my app on my cellphone ...
0
votes
0answers
41 views

cursor value has not been set with registeroutparameter while executing a postgres function in java using jdbc

Here is my java code: import java.sql.CallableStatement; java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import ...
0
votes
0answers
13 views

Create postgres .backup file using processBuilder

I want to do a backup and restore of postgres database via java application. The restore function work perfect using processBuilder but when I want to do the same thing for the restore function I get ...
0
votes
0answers
12 views

Restore postgres DB from JAVA application

I want to restore my postgres database from java application but I get this error: pg_restore: [programme d'archivage (db)] the connection to the database « certificat_test » failed : fe_sendauth: no ...
0
votes
0answers
23 views

OrmLite “like” method with PostgreSQL, case sensevity

I use for search the following code. (with SQLite db) QueryBuilder<Product, Integer> queryBuilder = getProductDao().queryBuilder(); queryBuilder.where().like(Product.PRODUCT_NAME, "%" + ...
0
votes
0answers
31 views

column “st_srid” does not exist

Hi I'm executing this query in my java code and it tells me org.postgresql.util.PSQLException: ERROR: column "st_srid" does not exist However when I run it directly in pgAdmin it shows me the ...
0
votes
0answers
19 views

how to map a non-entity result set coming from a NameStoredProcedure in JPA 2.1?

I am calling a postgresql procedure using jpa 2.1 and would like to convert the result set to a non-entity class called StoreAndCategoryID containing two integer fields called: storeid, categoryid. ...
0
votes
0answers
14 views

How to map Results when Querying raw SQL using Ebean

Using Postgres Tables created by Ebean, I would like to query these tables with a hand-written statement: SELECT r.name, r.value, p.name as param1, a.name as att1, p2.name ...
0
votes
0answers
25 views

How to create PagingQueryProvider with multiple sortKeys?

I want to create a distinct on query with PagingQueryProvider: PostgresPagingQueryProvider queryProvider = new PostgresPagingQueryProvider(); queryProvider.setSelectClause("DISTINCT ON ...
0
votes
0answers
20 views

Sequence of Insert's in Batch Insert vs Sequence of Result from PreparedStatement.getGeneratedKeys()

I want to know whether the sequence is maintained between PreparedStatement.addBatch (i.e., adding an insert statement into the batch) and result returned from PreparedStatement.getGeneratedKeys() ...
0
votes
0answers
23 views

Invalid XML document when Updating xml field with string longer than 10M

I am trying to update an xml type field in a PostgreSQL table with a large string. If the length of the data is >10M characters I am getting an error back from the server. We are using UPDATE ...
0
votes
0answers
50 views

simpleJdbcCall returning only 1 row

I have written a stored procedure in pl/pgsql and it is working fine in pgAdmin. And i am using simpleJBDCCall to call the procedure which returns a set of record. When i call the stored procedure ...
0
votes
0answers
35 views

Performing range filters on aggregated field (e.g. Avg of score) in Elastic Search

I am using latest Elastic Search Version 1.3.2. I just want to perform range filter on an aggregated field (e.g. Average of students score). I am using the following query .. { "query": ...
0
votes
0answers
38 views

PostgreSQL & JDBC: INSERT INTO with RETURNING returns empty result set

I have an insert statement with a returning value. The problem is, only the INSERT INTO part works, but returns nothing. I tried with table attributes and constant values too. I am using ...
0
votes
0answers
18 views

Dangling open transaction with JPA

I've got a ws app running with a postgresql (9.3) db using JPA with Hibernate as persistence provider. When I terminate the app I get a 'unexpected EOF on client connection with an open transaction' ...
0
votes
0answers
39 views

Concurrent struts action calls on the same method

I'm using struts2 and spring integrated framework, hibernate and Postgres SQL in my project. During performance testing there is an issue when more than 2 users are trying to insert the same ...
0
votes
0answers
25 views

How to map org.postgresql.geometric.PGpoint to Hibernate Type

I'm migrating my application from spring jdbc to JPA + Hibernate and the DB used is postgres. One of my table in the DB has point data type which translates to org.postgresql.geometric.PGpoint if i ...
0
votes
0answers
62 views

No working postgresql connection in OpenShift jBoss web app

I've been having this problem for over a week now and I cannot find any leads to solving it. I have a Java EE web application, initially built using jBoss Tools Forge, following the guide on ...
0
votes
0answers
18 views

how to retrieve attachments from postgres in the original format?

The attachments in my postgres are stored in bytea column. I am retrieving their names in jquery grid. And on click of the name the attachment starts downloading. The problem here is the attachment is ...
0
votes
0answers
47 views

JNDI Postgres Datasource - Tomcat 6 - Axis2 Web Service

I have written a Axis2 Web Service. This service communicates with a Postgres database. For this communication I would like to use a JNDI DataSource but it is not possible for me. The file ...
0
votes
0answers
53 views

Spring JDBC With transaction commit fails

I'm working on a Spring JDBC project using transactions. I'm using PostgreSQL as a database : Here is my spring configuration : <tx:annotation-driven/> <bean ...
0
votes
0answers
44 views

Hibernate config with Postgres and Heroku

I am using Hibernate to perform all my db actions on a Postgres db. Everything seems to work fine when I use a local instance of the Postgres db. However, when as I try and use the remote dev ...
0
votes
0answers
53 views

@Schedule task with timer service and JPA transactions for EJB applications

I'm new EJB application developer. I'm using Glassfish4, EJB3.1 and Postgresql. There's a problem in JTA transaction in my application. The entity object does not update when I use @Schedule method to ...
0
votes
0answers
27 views

Glassfish and Java EE external JAR

I am trying to use postgres on a EJB in a EAR, but i keep getting the error: java.lang.ClassNotFoundException: org.postgresql.driver so my app is not finding the jar. According to what I saw ...