2
votes
0answers
92 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
48 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
149 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
175 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

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
63 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
47 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
61 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
67 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 ...
1
vote
0answers
62 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
124 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
304 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
168 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
35 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
58 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
59 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
133 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
130 views

Error in SPRING JPA using eclipse link POSTGRESQL when executing findBy[NAME]In(List<Long> ids)

I got a problem with my SPRING JpaRepository class when trying to use the findByIdIn(List ids), eg i want to pass a list of ids to the native query and expect it to return a list of objects. Maven ...
1
vote
0answers
249 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
17 views

How to store java.util.ArrayList in Postgresql using Spring

I am trying to do a batch-insert of a collection of beans. One of the properties of the bean is an ArrayList. The batch update fails with the exception: Can't infer the SQL type to use for an ...
0
votes
0answers
21 views

Hibernate disable all cache and execute pure SQL

I have an entity Foo with two fields - id and value; Every time the value changes, a new record is created in foo_audit table. foo_audit table consists of thee columns: timestamp | id | value | ...
0
votes
0answers
28 views

Unable to Configure EntityManagerFactory - JPA

I have an application developed in GWT + Errai using Postgres as backend, deployed in jboss7. I have recently migrated the whole application from one Openshift (Origin) instance to another with rhc ...
0
votes
0answers
19 views

Connecting Android app to Postgresql Database using JDBC driver, but the connection is refused

I have been trying to find an answer to this, but I can't seem to find anything else to help me. I have edited the config files several times to go with answers to other questions with similar ...
0
votes
0answers
34 views

Speed up PostgreSQL query in JDBC

I'm running a query against a large PSQL database in order to do a bit of parsing on the results, but I'm having a problem with the speed of it. The selection query is as follows: SELECT cycle_id, ...
0
votes
0answers
28 views

Avoid ConstraintViolationException in JPA and OneToMany relationship when merge

What I want to achieve with the example below is to avoid the constraint violation exception that occurs when run the following: Parent p = new Parent(); Set<Child> children = new ...
0
votes
0answers
11 views

arjuna transaction manager nonxa hibernate update

i tried using apache dbcp basic data source for nonXa transactions using arjuna transaction manager for hibernate and postgres. update fails always even though i can see updated data in the db with ...
0
votes
0answers
32 views

Insert JSON to Posgres table

In my Java app I would like to insert a new record to a Postgres table which one of its column is JSON type. I use Hibernate 4.x The entity class looks like this: @NamedNativeQueries({ ...
0
votes
0answers
21 views

JPA NamedQuery without table in database

I have two tables in my database: packet_type and unit. I've created something-like-entity class PacketTypeExt to fetch joined data from both tables. I have simple namedquery: ...
0
votes
0answers
39 views

Logging SQL on error only

I am currently logging sql from hibernate using p6spy in order to get the full sql with the parameters in it so it can be copied and pasted easier for debugging. However I want to log only when the ...
0
votes
0answers
13 views

Column querying from connection not working for Postgresql but not for Hsql in Java

I am encountering weird behavior where my integration tests for my JPA Configuration are failing for postgresql but passing for hsql. There are no code changes to the test and assertion method. I ...
0
votes
0answers
15 views

Integrating a Full Text Search to an Existing Database using ElasticSearch

Is it possible to integrate ElasticSearch as a Full Text Search Provider with an Existing Postgresql Database?
0
votes
0answers
13 views

ST_AsKML Equivalent for java

PostGis has an incredibly useful function called ST_AsKML that converts a geometry to KML format. Is there any sort of equivalent in Java anywhere?
0
votes
0answers
18 views

How to send data to json data type column in postgres by using Gson

I have a column like json type in my postgres.I am trying to send data and to retrive data by using Gson and taken in entity like below JsonObject metadata; for retriving the code like below (I am ...
0
votes
0answers
28 views

@JoinColumn with a composite PK

I've searched a lot around internet and I didn't find any solution to my problem. Any help will be so appreciated. I'm using Servicemix 4.5.3 and I have all my dependencies installed (other ...
0
votes
0answers
30 views

Parametric Subselect Java

I've a query as subselect in class which casts to entity. The numbers in query "123456789" I need to put these numbers as a parameter which I called this class from another method in another class. ...
0
votes
0answers
20 views

List indexes set to null in Hibernate

I would like to persist a list of elements with cascade set to "all-delete-orphan". In order not to get the exceptions telling me that the list with "all-delete-orphans" is not tracked every time I ...
0
votes
0answers
31 views

PostgreSQL Query in Java won't sort using Order By

I'm making a database query to a PostgreSQL server using Java and the corresponding JDBC driver. The Query is: select starttime, duration from callhistory3 where is_answ = 't' and callerid NOT IN ...
0
votes
0answers
31 views

Order By String Field is wrong when parameter is null

I am using PostgreSQL and I'm trying to sort the result of a NamedQuery by some fields but I'm having trouble with this. Using Order By is not inserting rows in the result when some of the fields is ...
0
votes
0answers
24 views

H2 and Postgres array compatability

Can I get h2 to support Postgres array syntax CREATE TABLE artists ( release_id integer, artist_name text, roles text[] ) I use h2 to mimic Postgres in my unit tests, but it doesn't like the above ...
0
votes
0answers
26 views

PostgreSQL Java Authentication error

I am trying to connect netbeans with postgreSQL. However, it gives connection error even though my username and password is correct. Following code is my persistence.xml. Can you help me please? ...
0
votes
0answers
42 views

Integration tests run from gradle build but not from intellij?

Following is the stacktrace I get, when trying to run the test java.lang.IllegalStateException: Failed to load ApplicationContext at ...
0
votes
0answers
27 views

Linux tomcat7 postgresql jar file location

I am trying to run the JasperServer BI platform on my own tomcat7 instance. I get the Cannot load JDBC driver class 'org.postgresql.Driver' error message when I try to start it though. Here is my ...
0
votes
0answers
20 views

Filtering the value according to in clause one by one using postgresSQL and java

I have got the value from database according to in clause, i want to filter value according to condition. e.g. if i have 5 variable i want to get the value one by one. how can i do it. code ...
0
votes
0answers
26 views

Dropwizard Migrations: defaultSchemaName property is not working in dumping schema in postgresql

I am using command java -jar myJarFile.jar db dump configuration.yml to generate the changeLog of liquibase. My database configurations file looks like: database: driverClass: ...
0
votes
0answers
19 views

Java - Multiple client server sending message to a chosen client

I have a java-server that accepts multiple clients through accept() method and spawns new threads as follows: while(flag) { client = serverSocket.accept(); // I request an identification ...
0
votes
0answers
28 views

add an entry to postgresql using hibernate

I'm trying to add an entry to my postgresql database using Hibernate 4.3.4, and this is my code : public class HibernateTest { public static void main(String args[]) { UserDetails user = ...
0
votes
0answers
28 views

JSF Seam. How to upload to server with filename in database

Ok I currently have a working model where a user uploads a file to the database (postgresql) along with other data. I would like if the user could instead upload the file to a server and only the ...
0
votes
0answers
63 views

org.postgresql.util.PGobject cannot be cast to java.lang.String

trying to learn how to use PostgeSQL data base, and JAVA with ENUM's and got some problem with casting. Here is my sql: CREATE TYPE enum_created_from AS ENUM ('CHAT', 'WEB'); ALTER TABLE contact ADD ...
0
votes
0answers
25 views

Spring JdbcDaoSupport calling function from postgresql database

I would like to call following function from my postgresql database: CREATE OR REPLACE FUNCTION dydaktyka.ins_uzytkownicy(p_stopien text, p_imie text, p_nazwisko text, p_login text, p_haslo text) ...
0
votes
0answers
33 views

Hibernate findByParam UUID

I am editing existing project. My task is transform Integer primary keys to UUIDs. I have already edited database, but now I have problem with Hibernate. In this function: public ...