Tagged Questions
0
votes
1answer
12 views
Spring Data JPA using EclipseLink as JPA provider: possible bug in EclipseLink?
I use Spring Data JPA and EclipseLink 2.5.2 as my JPA provider. The database I use is PostgreSQL. I have a table that has an auto increment serial ID as the following:
CREATE TABLE segment
(
caseid ...
0
votes
1answer
18 views
Convert oracle.sql.timestamptz to postgresql timestamp with timezone
Sorry, but i`m noob and i need your advices.
I have some result set from oracle with timestamptz, i get string value of this timestamptz which like
2014-1-10 13.47.56.0 7:0
and then I need put ...
0
votes
0answers
14 views
Glassfish and JEE 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 ...
0
votes
3answers
37 views
Optimization for fetching from a bulky table
I have a PostgreSQL table that has millions of record. I need to process every row and for that I am using a column in that table namely 'isProcessed' so by default it's false and when I process it I ...
0
votes
0answers
29 views
Calling functions in postgres like the package in Oracle {call schema_name.package_name.function(?,?,?,?,?,?) with placeholders
Converting a package from oracle to POSTGRES But POSTGRES does not support the package so firstly convert the packages to function through Ora2pg tool.
Situation is That the package is being called ...
0
votes
1answer
18 views
How does postgresql Date relate java Date?
I am working on a project that requires to get the time when a new customer creates his account, and then keep that time in the database for later use. However, I dont really understand the ...
1
vote
0answers
23 views
Error: Could not find or load main class JDBCExample
Hello I am trying to run a java file in cmd (Windows) with this:
C:\test>java -cp c:\test\postgresql-9.3-1102.jdbc41.jar;c:\test JDBCExample
where postgresql-9.3-1102.jdbc41.jar & JDBCExample ...
0
votes
0answers
21 views
Storing JAR's in PostgreSQL DB
Does something special need to be done when storing JAR's as binary in a PostgreSQL database, so classes can be loaded dynamically at runtime? I use the following function below to import a given jar ...
-5
votes
0answers
24 views
How to get Cardinality PostgreSQL in Java [on hold]
I have a Database and i would like to get the Cardinalities between the Tables. How can i do this ?
There are 3 kinds of Cardinality 1-1 , 1-n and n-m and i would like to list the Tables and their ...
0
votes
1answer
27 views
MyBatis work with dynamic queries, such as count(*) or data in a new column
Lets assume I have user_partner_table
id, user_id, partner_id, app_completed, user_name, partner_name
1, 2345, 232, t, sam, A&C Bank
2, 2345, 121, f, sam, M&M Bank
3, 4324, 123, t, tom, DC ...
-3
votes
3answers
43 views
How to implement push notifications on my android device
I have a very basic design of my entire application, where several users with my app on there android devices commits data to the server (I have used REST web services(java) + postgresql as my server) ...
-1
votes
0answers
14 views
Locking in postgres compromising preformance
I am in a fix. In my application I am performing a specific function which is locking a lot of tables. when i try to concurrently perform another function (which is using the locked tables) it gets ...
1
vote
2answers
36 views
Insert data into row in PostgreSQL column by column
I created a table in a PostgreSQL database with 42 columns. Five of them are bigint type, whereas others are character varying type. I then tried to insert data into using some java code and the jdbc ...
0
votes
1answer
28 views
null data for second access
Well, sadly I do not even know how to describe this error lol :(
I want to display an image which I have stored it's path in the database. And my code works perfectly for the first time it accesses ...
0
votes
1answer
27 views
Transaction started but not ended on database test connection query
Recently a bug was noticed in our application which caused the time of the operation to differ from the actual time(we are using current_timestamp() PostgreSQL function instead of passing time from ...
-2
votes
1answer
19 views
Accessing elements of a ResultSet with only one tuple, returns exceptions
When I carry out the following operations:
public Product getProductById(long productId) throws DaoException {
Connection con = DBManager.connect();
PreparedStatement statement = null;
...
0
votes
2answers
30 views
Multiple Spring modules dependecy
I'm trying to deploy an Spring web application that has as dependendy another Spring Application (in this case a jar) where this jar has all the domain definition and database connection info. The ...
1
vote
1answer
25 views
Manually locking of DB necessary even if I use Hibernate/Postgresql/JDBC?
Sorry to ask this in case it has been answered before, but I heard (from a potential other noob) that Hibernate has/had some kind of connection pool manager that also handles locking of the database. ...
0
votes
0answers
22 views
List as Input parameter in Postgresql Stored function using Java
I am new to Postgresql. I want to pass an ArrayList to the postgresql stored function. How can I pass this ArrayList to the Postgresql function using Java ?
Here is my function
CREATE OR REPLACE ...
1
vote
1answer
26 views
I can't conect to my heroku postgreql database from Java. What I am doing wrong?
Hy,
I am have a Heroku postgreql database on which I can't connect from Java. I have tried different methods but without succes.
Bellow is my Java code:
import java.sql.Connection;
import ...
-1
votes
0answers
18 views
Issues in accessing R scripts through Java Spring framework
I have an application which is based on Spring framework. I also have an R script which accesses database(Postgres), does some computation on data and returns result to database. This R script is then ...
0
votes
2answers
51 views
Left joins on the same table
I'm using JPA Query Criteria to build a query with a join on the same table. The table looks like below.
Table A
Id EventType
A Start
A Start
A End
B ...
0
votes
2answers
33 views
Exception using jTable and Hibernate on Paging & Sorting
I'm getting the following exception:
org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: org.postgresql.util.PSQLException: ERREUR: constante non entière dans ORDER BY
...
0
votes
1answer
36 views
How can we auto increment one of the columns of a compostite primary key?
CREATE TABLE abc(
seq_id INT NOT NULL,
name VARCHAR(30) NOT NULL,
value VARCHAR(100),
PRIMARY KEY (seq_id, name)
);
The table contents would then be:
Seq_id ...
0
votes
1answer
26 views
Prevent dropping a persistent connection
We are using Talend and rest web services to store data on Heroku. After some idle time our persistent connection gets dropped. I have search postgresql documentation but I cannot find any parameter ...
0
votes
3answers
31 views
How to set '5 day' (datetime interval) in jdbc for PostgreSQL?
Considering the following example
select * from foo where time +'10 day' >current_timestamp
I would like to make this query parametrized for Java, and I don't know how to set the 10 day?! ...
1
vote
4answers
68 views
Count number of days between 2 dates in JPA
I need to count the number of days between 2 dates in JPA.
For example :
CriteriaBuilder.construct(
MyCustomBean.class
myBean.get(MyBean_.beginDate), //Expression<Date>
...
0
votes
1answer
15 views
MyBatis run native Query
I want to do DB auditing, for that I need to set ee.username for the connection used by mybatis.
My question is how could I do that. I tried to look for many search results but couldn't find anything ...
0
votes
0answers
38 views
Translate Native Query to Hibernate Query
I have following method to extract data from DB table
public User getNextUser() {
final EntityManager em = getEntityManagerFactory().createEntityManager();
final String ...
0
votes
1answer
24 views
PostgreSQL getSequence current value and pass to id
I have a question reqarding function/triggers in postgreSql.
I havae 2 following classes:
abstract public class person(){
int personid;
}
public class employee extends person(){
int employeeid;
...
8
votes
2answers
85 views
Does it make sense to have a sql PreparedStatement pool?
As a PreparedStatatement contains precompiled sql command(s), so when if we make a pool of this type in order not create and destroy this object too much(just like thread pool).
Does it make any ...
1
vote
2answers
30 views
Should I use preparedStatement in a repetitive query in which where clause predicates change often causing change of plan chosen
I have a Java application which is executing queries on PostgreSQL 9.3 Server using JDBC. In my java application, I had to execute same query many times(in thousands) with different arguments in ...
1
vote
2answers
31 views
Tomcat Realm forms: login always fails
The Tomcat Realm (Forms) authentification in my JSP project worked well before i changed OS to linux, now it doesn't: login is always fails.
IDE is IDEA.
The project uses:
8.0.9 Tomcat JDBCRealm
...
0
votes
0answers
28 views
Not generate Hibernate POJOs from Database PostgreSQL?
I have created my tables and relationships in the database PostgreSQL, but when I want to generate Hibernate Mapping Files and POJOs, they are not generated
I applied all the appropriate steps to ...
1
vote
1answer
19 views
UUID not working with JOOQ and PostgreSQL
Whenever I try to set or retrieve a field of UUID type, I get the following error from JOOQ: "Not supported by dialect : Type class java.util.UUID is not supported in dialect null"
Everything else ...
1
vote
2answers
56 views
JDBC error on IS NULL condition
I am using JDBC from Scala using ScalikeJDBC library.
Let's take a simple query: UPDATE "test_table" SET "test" = 1234 WHERE ("asdad" is null)
If I pass this query directly to psql or execute it ...
0
votes
1answer
21 views
java.util.Properties adds \t characters on .store()
this is my original postgresql.conf:
#
#Wed Jul 23 16:13:09 IST 2014
lc_monetary='English_India.1252' # locale for monetary formatting
listen_addresses='*' # what IP address(es) to listen ...
1
vote
2answers
50 views
Convert PostgreSQL bytea-stored serialized-java-UUID to postgresql-UUID
One of our software-projects uses a PostgreSQL-table with a column 'guid' of type bytea.
This is used with hibernate 3.3.2.GA with PostgreSQL 8.4, which serializes the java UUID type using java ...
2
votes
0answers
55 views
duplicate key violates unique constraint when using multi-threading [migrated]
I am using ExecutorService with a fixed thread pool of 50, and a fixed database connection pool of 50, using HikariCP. Each worker thread processes a packet (a "report"), checks if it is valid (where ...
-2
votes
0answers
25 views
Postgres encrypt java decrypt
I am encrypting text data using PGCRYPTO in postgress ...
I am accessing the data in JAVA and decrypting the data using JAVA
The data is encrypted using 3DES.
However the data is not being ...
0
votes
0answers
28 views
Bad value for type int : text Hibernate issue
Folks I am passing a Person Object (not null) to this method and I am getting this problem from my stacktrace
SEVERE:
Servlet.service() for servlet [spring] in context with path [/api] threw ...
0
votes
0answers
30 views
Problems using Mondrian OLAP with REDSHIFT
I'm doing some work with Mondrian OLAP, trying to generate those cubes with PostgreSQL and the Tomcat7 web server.
No problem at all at the beginning, using localhost. The foodmart example worked ...
0
votes
1answer
67 views
How can I set my back end values to my form text field in play framework
I created a login page..if the user is already registered, the login will work and it redirect to profile page..After submitting values in profile, the data will store in database. Again the same user ...
0
votes
0answers
39 views
Displaying database records returned from postgresql to R through Java
I have a R script which returns a set of records from the postgresql to the Java program and I want to print those records in Java.My script is like this:
library(RPostgreSQL)
fnct1 <- function()
...
0
votes
1answer
20 views
Mahout's cross-entities, multi-input recommendations
I have a number of boolean data sets, like:
Books:
book_id user_id
1 1
2 1
3 1
3 2
3 3
and
Movies:
movie_id user_id
1 1
1 2
1 3
...
0
votes
0answers
52 views
Dynamically switching databases at runtime with Spring 4 + Hibernate 4 using AbstractRoutingDataSource
I have a web app that up until this point exclusively was configured to use an in-memory HSQL database. I have a pure JavaConfig configuration. My goal was to modify the config to use a ...
1
vote
1answer
21 views
Java PostgreSQL arrayList<Object[]> insert code- applying to any number of colums
I've got a method in Java for inserting an ArrayList into PostgreSQL.
public void postgreSQLInsert(String tblname, String col1, String col2, String col3) throws SQLException, IOException, ...
0
votes
1answer
20 views
how to specify host using ip address instead of name to connect to postgres database using netbeans in a java project?
i want to add database to my netbeans java project using ip address.
my question is that when i specify hostname by name that is "localhost" followed my correct details in the new connection wizard in ...
0
votes
1answer
36 views
why is JPA using incorrect column name in insert statement
I am trying to insert a record into a table using the JPA. I get an error from postgres that a column name is incorrect. The column in question is a foreign key to another table.
Internal Exception: ...
0
votes
0answers
29 views
JDBC transaction with query return
I have a problem with transactions in JDBC, I want to execute inserts and I need the auto generated key value but if I commit at the end of the code Java will throw a NullPointerException.
I set ...