Tagged Questions
0
votes
1answer
13 views
Why Wildfly 10 gives me “Empty name segment is not allowed for jdbc:postgresql” at deploy?
I have a and application having an ejb module packaged into an ear file. When I want to deploy to Wildfly I get the error below. According to this post something is not ok with standalone.xml file. I ...
-1
votes
0answers
22 views
How to Import CSV file into PostgreSQL DB using Java?
I've to import a CSV file into a Postgres database.
I've tried using a scanner but it's very slow (the file has more than 9000 rows).
I've also tried to use the command "COPY", but it gave me the ...
0
votes
1answer
25 views
Insert in postgres DB - Hindi
I am creating a Java application where I would like to enter data in languages other then English. E.g. I want to enter data in Hindi (UTF-8) character. I have converted the data to hex string '\xe0\...
0
votes
0answers
39 views
NullPointerException while connecting to postgres Spring MVC
I wrote this code:
Controller:
@Controller
@RequestMapping("/groups")
public class GroupController {
@Autowired
private GroupService groupService;
@RequestMapping
public String ...
0
votes
2answers
24 views
Perform insertion of data into multiple tables using JDBC in one function
I need to perfom data base insertion in my spring boot webapp. What I have so far is a list of sport competitions and there respective informations.
one competition can hold at different time the ...
0
votes
0answers
17 views
JPA character stream
What is the JPA way of storing a character stream into a database field?
In my code I want to run a process and store the error code and the standard output into a database record. Now, since I'm ...
-6
votes
0answers
33 views
PostgreSQL driver for Java 7 [on hold]
I could not connect to PostgreSQL with a Java 7 application.
I tried all drivers given in https://jdbc.postgresql.org/download.html for Java 7.
But I could not get any of them to work properly.
Can ...
1
vote
0answers
9 views
Error while running HQL From PermitApproval
The error is encountered only while running HQL :
From PermitApproval
i.e from hibernate.xml file in netbeans. Running query in postgres (i.e select * from permitapproval) no such error appears.
...
0
votes
1answer
27 views
Call Procedure / Function JPA Hibernate
Hey guys I have a procedure in postgres SQL and I'm trying call it using jpa hibernate, but I'm getting error.
select * from myprocedure(2016, 3, 0, 0,0)
AS f(descricao varchar, itens integer, ...
1
vote
2answers
47 views
Direct db connection per http request vs connection pooling- what is the difference
Let's say I am storing data of Person(id, country_id, name). And let's say user just sent the id and country_id and we send back the name.
Now I have one db and 2 webserver and each webserver keeps a ...
0
votes
0answers
30 views
Running more than one query from java code on PostgresSQL
I have a table and I'm trying to run k queries on that table.
The problem is that after running each query,I'd like to SELECT some data then I want to run the next query on the result of the previous ...
0
votes
1answer
26 views
Hibernate mapping missing column error
I am using hibernate mapping in a project in Java and I have an error that I cannot figured out. I have several tables that includes column names all in lower case (e.g. db_id). To use them in Java, ...
0
votes
0answers
13 views
Postgresql backup using java in linux is not working
I want to take PostgreSQL db backup using Java. I tried below code but it's not showing any error and it is not creating a backup file, plz give solution.
List<String> cmds = new ArrayList<...
1
vote
0answers
16 views
Trying to create a method that uses an outside object for a PostgreSQL query
I am working on a personal project where I am trying to come up with a password storage system.
Where I am currently stuck is the portion where I am trying to enter in the website, username, and ...
0
votes
0answers
9 views
Entity outside Persistence Context get changed when is ought not to
I use Java + JUnit 4 + PostgreSQL for my project. I write the integrity test. For this test the idea is: I create an entity, save it to DB. Then I find it in the DB, put in another variable and change ...
0
votes
0answers
45 views
Java LocalDateTime Deserialize
I came across an @Entity and one of the its columns is LocalDateTime.
Normally LocalDateTime value should be converted to an SQL Timestamp value with converter however for this LocalDateTime column, @...
0
votes
1answer
34 views
How to invoke PostgreSQL function using spring jdbctemplate instead of direct insert query in Java?
I am new to PostgreSQL. I need to call postgresql function from spring jdbctemplate for storing Employee table details. Below is my code in which I am using insert query to store the Employee details. ...
1
vote
1answer
24 views
How to take PostgreSQL database backup using Java
I want to use a PostgreSQL db for backup using java.
I've tried with the below code but I am getting:
error pg_dump: too many command-line arguments (first is " postgres") Try "pg_dump --help" for ...
0
votes
0answers
22 views
insert on conflict(guid) do batch update using NamedParameterJdbcTemplate doesnt work
I am using NamedParameterJdbcTemplate and I want to do a batch update using the on conflict sql statement
sql = "INSERT INTO bl_crm_activity_line (guid,hdr_guid) VALUES (:guid, :hdr_guid,)
ON ...
0
votes
1answer
21 views
Heroku don't create table on postgresql
I have problem with creating table on database, when start app I get this exception
There was an unexpected error (type=Internal Server Error, status=500).
could not extract ResultSet; SQL [n/a]; ...
0
votes
2answers
54 views
Update only not null fields
How to tell hibernate to not update fields with null values ?
I have filled entity (without password field which is not-null field). I want to update all filled fields in entity (skip the fields with ...
0
votes
0answers
18 views
Make db postgres from ant
i'm making an application that query a DB in the server. I need to create the DB from ant command, this is my code:
<target name= "makedb" description= "create database" depends="compile"> ...
-1
votes
1answer
20 views
how to work with apache spark with hibernate using postgresql [closed]
I have my application which is pulling/updating data from postgres db using REST calls written in java using hibernate framework,now I want it to use apache spark for faster retrieval/updation of data,...
0
votes
1answer
15 views
How to Stored symbol or Special char in postgresql [duplicate]
I am in trouble that how to be inserted symbol like single quotes(any other) in postgresql database. There are many solutions from this site that i have tried but my problem is not get solved.
I ...
0
votes
1answer
24 views
Configuring JTA in Tomcat7
I am using JEE5 with Postgresql, When I try to persist the object the output says
Could not find datasource: java:jdbc/postgres
javax.naming.NameNotFoundException: the name jdbc/postgres is not
...
-2
votes
0answers
19 views
Postgresql connection error [closed]
When I try to test the connection to my postgres database I get this error message:
org/jetbrains/dekaf/jdbc/SqliteIntermediateFacade
http://imgur.com/a/ZD7qj
I can still access the database from ...
0
votes
2answers
47 views
JPA How to return result without joining other tables?
I'm writing a service with JPA and Postgres db. I have a class named Student:
public class Student {
@id
private String id;
private String firstName;
private String lastName;
@...
0
votes
1answer
22 views
How to deploy on Heroku with Postgresql Database?
I have a simple rest app on spring. For deploy I've been created 2 profiles - dev & heroku. With dev profile it is all ok. But I can't deploy to Heroku:
[ERROR] Failed to execute goal org....
0
votes
2answers
31 views
How to tell if timestamp from Postgres in Java is null
The code below is a snippet from a back-end REST service I have touched on. I'm wondering how to tell if a timestamp I'm getting is null. I've learned through trial and error that if the timestamp is ...
0
votes
0answers
8 views
Calling NativeQuery.executeUpdate outside of transaction
We're migrating from Dropwizard 0.9.2 to 1.1.0 which includes migration from Hibernate 4.3.11 to Hibernate 5.2.8.
At the end of the session, we need to issue the SQL command DISCARD ALL to our ...
0
votes
3answers
33 views
How to use setParameter in Hibernate
I want to search all employees with the corresponding ids stored in the serialNumberList and add all their hours together. serialNumberList is a string containing the ids separated with commas. What ...
1
vote
0answers
29 views
Is it possible to create a QueryDSL Predicate with a String of raw SQL?
I have a Java, GraphQL, Hibernate, PostgreSQL, QueryDSL application that queries a very large PostgreSQL table with over 275 columns.
I've created a GraphQL schema with the 25 most popular columns ...
-1
votes
2answers
63 views
Postgresql Insensitive [closed]
I have a project with PostgreSQL configured, when the transaction happens with the PostgreSQL, I get exceptions on 'ID' does not exits such errors which is a case sensitive issue. How can I make the ...
3
votes
1answer
67 views
convert postgresql query to Native Query
I want to convert the below postgresql query to hibernate
query or any type of query that supports in java
WITH RECURSIVE tree(parent, idElement) AS
(
--Anchor member definition
...
0
votes
1answer
38 views
How to separate data into two tables with Spring Boot?
Now I have two tables, the first table called StudentBase and has three columns: id, firstname and lastname. The second table called ResearchAssistant and has two columns: id and course. I designed ...
0
votes
1answer
36 views
JPA Criteria API for WITH clause and subquery in FROM clause
I`m new to JPA and I would like to implement a query that contains WITH clause, and also subquery in FROM clause by using JPA Criteria API, for example:
WITH A AS(...) SELECT a1,a2 FROM A
and also:
...
0
votes
0answers
26 views
mybatis collection resultset maaping issue. Getting empty collection resultset
I'm new to mybatis and facing an issue with getting a collection in a resultset. The resultset is defined as below:
<resultMap type="User" id="userMap">
<id column="id" property="id" ...
2
votes
0answers
68 views
How to solve this error : ERROR: operator does not exist: character varying = integer
I am a beginner in Java EE and spring. Actually I program an application and I spent several hours on an error that I can't correct. I want specify that I look others topic that deals with this ...
0
votes
1answer
13 views
Hibernate named paremeter: set view as parameter
I'm wondering if its possible to pass a view or materialized view as a parameter in Hibernate. For example:
String view = "some_view";
Query query = entityManager.createNativeQuery("refresh ...
1
vote
0answers
27 views
Java & PostgreSQL & Hibernate. Mapping a multidimensional array
Hello!
I'm trying to map three-dimensional array from PostgreSQL with Hibernate. A need to store weights of Multi layer neural network. How should I do it better?
All source I've met was too old. It ...
0
votes
1answer
67 views
Jooq notation for unnest with multiple arrays
I want to mix in external timezone per location info to filter rows that has timestamp without timezone values.
How can I express in Jooq this SQL (Postgresql) snippet
WITH
now(locaton, value) ...
2
votes
2answers
29 views
How to take the previous entries for an id
I am having a database table in postgresql like below
entry_no id time
________ ____ ______
1 1 2017-03-21 00:12:10
2 2 ...
1
vote
1answer
56 views
How to execute an sql query without starting a transaction with PostgreSQL JDBC?
I need to execute such query with PostgreSQL JDBC:
alter type devel.enum_test add value 'third';
So I get org.postgresql.util.PSQLException saying that ALTER TYPE... ADD cannot be executed inside ...
1
vote
2answers
24 views
JAVA JDBC Driver PostgreSQL: Parse numbers encoded as BYTEA object
I have relation where for each record there is BYTEA column (UTF-8) encoding 3 numbers in the following order:
bytes 0-1: number 1
bytes 2-3: number 2
bytes 4-6: number 3
How can I parse the ...
1
vote
1answer
15 views
Creating a Query on Java using an FK as filter
I have a class called Curso and a class called Disciplina.
Disciplina has a FK from Curso called id_curso. I want to filter Disciplina's using Curso's ID as a fitler.
public List<Disciplina> ...
0
votes
1answer
21 views
why is findById method of hibernate resulting in “unable to locate persister UnknowEntityTypeException” error?
I'm hoping you can help me solve this.
I'm trying to use hibernate 5.2 on my web java project. So far, I have managed to make the connection with the database using the hibernate.cfg.xml file, also I'...
-1
votes
1answer
34 views
How to lead in postgresql?
I have a table in the below format
id task_start_time task_end_time
__ _______________ _____________
1 2017-03-21 00:09:10 2017-03-21 00:12:18
1 2017-...
1
vote
0answers
12 views
Changing JBoss BRMS DataSource to use PostgreSQL JDBC driver
I am working to change the default H2 Datasource of JBoss BRMS 6.4 to use PostgreSQL JDBC driver. I am using JBoss EAP 6.4 as container for JBoss BRMS 6.4. The name of my postgresql driver is : ...
1
vote
0answers
14 views
PostgreSQL and Apache Derby proper column name in JAVA Dao
I have Dao layer on Java.
When I call insert method i want get "id" of inserted row.
Im doing like this
connection.prepareStatement(INSERT_SQL, new String[] { "id" }))
All works fine in Postgres. ...
0
votes
1answer
17 views
Hibernate Spatial 4 error unknown SQL type to be used in insert with org.postgis.PGgeometry
I've a issue when i try to store an hibernate spatial point to o PostgreSQL db with PostGis extensions installed.
Essentially, when I try to insert the record into the table the org.springframework....