0
votes
0answers
3 views

How to do I deploy a Spring app using Postgresql to Heroku using Spring Boot?

I am evaluating Spring 4 on Heroku and I am so far very impressed with both. However, I am having trouble getting my Spring Boot app to run on Heroku. Everything is working fine, except Postgresql ...
1
vote
1answer
16 views

Calling (Postgres) function within a JPA repository

I'm trying to call a function that I have defined in my Postgres DB. CREATE OR REPLACE FUNCTION bacon() RETURNS text AS $BODY$ SELECT cast('ingeborg' as text) $BODY$ LANGUAGE sql STABLE; ALTER ...
0
votes
4answers
32 views

Should hibernate use unique sequences for each table?

I have several entities using AUTO key generation strategy with Hibernate and postgres. @Id @GeneratedValue(strategy=GenerationType.AUTO) private Long id; This will result in a hibernate_sequence ...
0
votes
1answer
19 views

Amazon RDS: is there java API for PostgreSQL?

I'm new to Amazon RDS and stuck in a vast amout of information about it. So, my brain is rejecting new information now, that's why I decided to ask this question =) The question is: is there java API ...
0
votes
0answers
7 views

Dependency resolution for postgreSQL JDBC in maven for web app

I'm trying to create a simple web app on heroku using maven and postgreSQL , but when i'm running the code from eclipse i'm getting following error:- java.sql.SQLException: No suitable driver found ...
0
votes
1answer
22 views

Hibernate not updating ManyToMany associations during session

I am working on a project using Hibernate 4.3.4 to access a Postgres DB. We have two entities which are linked via a ManyToMany Association. The code and the associations currently work, in that ...
0
votes
1answer
18 views

glassfish confusing database name with username

Im having very strange issue with glassfish 4. If I specify wrong username/password for my JDBC connection pool and try to ping, I get (as expected): An error has occurred Ping Connection Pool ...
0
votes
1answer
15 views

IntelliJIDEA LoginException

In PostgreSQL, I have created role, lets say "example_role" in pgAdmin3, and tried to login in command promt and on glassfish server, which works in both cases, but not when I try to start the server ...
0
votes
1answer
48 views

id is autoincremented in database but is not set in the entity in hibernate

I have an id field which is autogenerated: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="id") private long id; In my entity, I define the sequence generation as: ...
0
votes
1answer
25 views

Implementing a java bean into a jsp servlet

I am trying to connect my JSP servlets to a posgress database and I am currently using a java bean class which is playing the role of the middle man. I am experiencing some difficulties with making ...
0
votes
1answer
20 views

Getting Weird Data while Parsing Date

I want to parse date from string received from Textbox but some portion of value doesn't parsed and gave me some default values and store in my DB : In my DB I have taken field type Timestamp without ...
1
vote
0answers
34 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
1answer
32 views

Postgresql Date type and java SimpleDateFormat

I have a database column of type date with the following value 2014-05-01 I then have the following hibernate mapping: @Temporal(TemporalType.DATE) @Column(name = "end_date", nullable = false, ...
0
votes
0answers
18 views

Eclipselink: PSQLException: FATAL: password authentication failed for user “usrname”

I'm trying to use JPA in my project to access data from database. I'm using Eclipselink as persistence provider and postgresql as database engine. I wrote a code that performs some CRUD operations on ...
0
votes
1answer
22 views

Where in a Seam bean do I direct the code to my database table?

I'm new to seam framework and I'm wondering if I have a xhtml page and a bean, where is the line that tells the bean the name of my database table and the command on what it needs to add or delete ...
0
votes
1answer
20 views

Geographically dispersed servers, PostgreSQL, and JPA

My database server's TIMEZONE is UTC. I have Java servers in various time-zones that interact with the database. Naively I discovered that if I have a TIMESTAMP field that there is really no way for ...
0
votes
1answer
20 views

How can I set the schema in a trigger with a parameter?

Here I am setting the schema that is using liquibase changeset in a Java/Spring. Until the moment it has worked with the table/key creation. But it doesn't work on custom SQL. @Bean ...
1
vote
1answer
28 views

ERROR : javax.servlet does not exist

I have checked almost all the posts possible for the error that I'm getting. Ive edited almost all the ENVIRONMENT VARIABLES as given online. These are my environment variables : ANT_HOME = ...
0
votes
0answers
30 views

Is there Java API for ETL to transfer database table data from SQL server to PostgreSQL server?

Is there any open source Java based ETL API? I have around 6 tables in SQL Server database server and similarly structured tables in a PostgreSQL DB server. The MS SQL Server DB was designed ...
1
vote
2answers
62 views

Hibernate: Create Index

I want to create serveral Indexes in my DB. Unfortunately we have to change the persistence provider from EclipseLink to Hibernate, but nor the solution with javax.persistence.Index neither the ...
0
votes
0answers
24 views

transaction in Spring Batch

The transaction does not work in spring batch Here is my code, SqlSession session = sqlSessionFactory.openSession(); System.out.println("1"); DataSourceTransactionManager txManager = new ...
-1
votes
0answers
39 views

java - reading csv file [duplicate]

I have exported a table to a csv file using command COPY table1 TO 'table1.csv' WITH CSV HEADER and then I'm reading this file into my Java program using: private List<String> fileToLines(File ...
0
votes
1answer
33 views

Gaps In the sequence values generated by JPA @GeneratedValue with PostgreSQL

For my desktop application I use JavaFX, Spring, JPA + Hibernate and PostgreSQL. Currently I have faced several issues. Issue one: Violation of PRIMARY KEY constraint SQL Error When I create Entity ...
0
votes
0answers
26 views

How to export data from Postgresql to mongoDB using java code?

i am trying to export data from postgresql database to MongoDB.I have successfully created string in JSON format and when i store this json in mongoDB collection, only first entry get stored. here is ...
0
votes
1answer
23 views

My Glassfish Exception report HTTP Status 500 -

message descriptionThe server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: An error occurred performing resource ...
0
votes
1answer
21 views

Incomplete ResultSet on Amazon EC2

I am running a JNDI JDBC connection pool on Tomcat hosted on an Amazon Web Services EC2 talking to an Amazon Web Services PostgreSQL Relational Database. I have a table with 40,000 rows of data that ...
0
votes
1answer
16 views

Production Database handling in Maven

I have written a REST webservice using JAX-RS and I currently prepare my test database using DbUnit. However, if I would now deploy may application, this would not fit my needs anymore. Thus, I am ...
0
votes
1answer
35 views

How access a postgresql database with an user different from superuser (postgres)?

In my spring application, I have the following Hibernate class to access my postgresql database: @Configuration @EnableTransactionManagement @PropertySource({ "classpath:persistence.properties" }) ...
0
votes
0answers
22 views

BatchUpdateException in Postgresql database?

I am working with Postgresql database and Java. I am trying to insert into Postgresql database using prepared statement so I am using Batch insert as well. And I am trying to insert 1000 records at a ...
2
votes
1answer
51 views

Storing Images of a Java based REST service running on Heroku

I am currently developing my first Java based RESTful service that should be run on Heroku. This service manages some objects that have associated images. As Heroku is not able to store this images ...
1
vote
0answers
69 views

Seam upload and download using s:fileupload not uploading or downloading

I'm trying to upload a file to a postgresql database however when I select the file is just does nothing after clicking upload. attachment.xhtml <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML ...
0
votes
1answer
45 views

Date is changed after persist in database?

User inputs date from JSP page, and it converts to Joda DateTime, the string output is 2014-03-26T00:00:00.000+09:00 However when I persist this entity containing date filed in database, and ...
2
votes
2answers
78 views

How to save or retrieve an array column using Hibernate

I use Postgres and I have one column ufsinss character(2)[] like array. I created userType model to use, because I found some posts in google indicating the way to deal with this problem, because ...
0
votes
0answers
29 views

Wrting and Reading a pdf file using java JDBC and PostgreSQL

I have a table with bytea data type on a PostgreSQL table. I am trying to write and retrieve a pdf file from the bytea data using JDBC resultset. However the file is corrupted while trying to ...
0
votes
0answers
16 views

Database as cluster or standalone server for Java Raspberry pi-cluster?

I'm doing a Java cluster on 4 raspberry pi's. I'm going to use Wildfly-servers. What is the best solution for the database-server (Postgresql)? I'm thinking either having one of the raspberry's as ...
0
votes
0answers
19 views

condition for the existence data in java servlet [duplicate]

i have created a ResuktSet as follows: ResultSet result = state.executeQuery("Select * from category where category_name='"+name+"'"); I use a postgresql dataBase. How can make the condition in ...
0
votes
1answer
21 views

Java: Json in a Heroku project

I'm exploring a very simple way: creating a simple server: public class SimpleServer { public static void main(String args[]) { ServerSocket s = null; PrintWriter writer = null; ...
0
votes
0answers
10 views

register the JForum application within glassfish 4

I'm newbie to jForum and Java EE in general I'm trying to install jForum on my web application based on the followings technologies : glassfish 4 as a server postgresql 9 as a database jsf 2 as a view ...
0
votes
1answer
30 views

postgresql: permission denied for relation

This is my first post, so please tell me if I should do something differently next time. I'm building a project using postgresql and java (NetBeans). When I try to execute a simple query (select * ...
1
vote
1answer
24 views

proper way to capture meaningful sql exception

In my java try - catch clause, I want to be able to capture the exact cause of a sql exception (I am using Postgres, but this question applies for all jdbc drivers). What I had to do is } catch ...
-1
votes
0answers
39 views

Prepared statement for Insert works but postgresql table does not update

I have a preparedstatement for Insert which runs successfully i.e. executeUpdate() returns 1.But my database does not get updated i.e. the value is not inserted. But, I have written a function for ...
0
votes
0answers
39 views

Parsing Bulky XML to load in DB

I have bulky (~500 Mb) well-formed XML files, which I want to parse and turn into relational form. Here are technologies of my choice Postgres DB (but I can use MongoDB if it gives any special ...
1
vote
2answers
29 views

java image white color extraction

how to extract each image with white color into separate sections as shown below? from the picture above, there will be nine separate section after the extract I have tried several algorithms such ...
0
votes
2answers
33 views

Problems in JOIN using Hibernate

I'm beginner in Hibernate in JAVA and do not know how to solve this problem I have two tables: Usuario and Certificado, and i want to create a relationship and theirs. Class Certificado: @Entity ...
1
vote
2answers
65 views

How to compare login credentials against a database using JDBC (PostgreSQL)

So I am attempting to make a simple chat messenger in Eclipse. At the moment I am stumped on how to compare the users login details against those stored in a database table. I have an 'askName()' ...
0
votes
1answer
37 views

Using custom dialect function in hibernate @Formula

I defined my custom dialect for HSQLDB: public class CustomHSQLDialect extends HSQLDialect { public CustomHSQLDialect () { super(); registerFunction("datediffsec", new ...
0
votes
2answers
57 views

How to implement a java code as a service in grails

I have written a code in java that help me to generate a pdf . I have used Itext libraries to generate it. This code also consists of database connectivity with postgres. I have used two jar files ...
0
votes
0answers
20 views

JDBC PostgreSQL update statement in batch update not giving desired reult

i am trying to execute update statements in batch but not getting the desired result. i have some records which are available in array list. i am looping through the list and updating the table. if ...
0
votes
1answer
38 views

How to obtain the contents of a td at the servlet

i have created a table in jsp, i want to obtain the contents of a td at the servlet. Here's the td of table that i want to get it contents: <td align="center" title="tdun" id="cat"> <%= ...
0
votes
0answers
41 views

Updating sql timestamp using java

I am currently facing a strange problem. I have created a database that contains a table users and a function that updates the modification timestamp: CREATE TABLE users ( id BIGSERIAL PRIMARY ...