Tagged Questions
1
vote
1answer
29 views
Inserting data from Java servlet to database
So i am trying to insert data saved in fields into my database, this currently doesn't work. I can put information into my database via the servlet if i am manually inputting data eg- INSERT INTO ...
0
votes
1answer
40 views
ERROR: relation “table” does not exist
i have a postgres database with a specific relation but when i use below code :
String format = "select * from %s;";
String query = String.format(format, TABLE_NAME);
Map<Long, ...
0
votes
1answer
33 views
Challenging token error
I improved the structure after a good observation from [http://stackoverflow.com/users/1690199/v-k] I am still getting a token error even though the syntax looks correct to me. More comments and ...
0
votes
1answer
22 views
Migrating Spring application from Postgres to Oracle: defining table's schema
I've a very complex java7+Spring3.2.0+hibernate3 web application that works with a Postgresql database. A client now imposed as requirement to use Oracle as a database for a project. I'm having ...
-3
votes
1answer
23 views
Error: org.postgresql.Driver in Android [duplicate]
class conextion in java:
try {
Class.forName("org.postgresql.Driver");
Properties props = new Properties();
props.setProperty("user","postgres");
...
0
votes
0answers
22 views
Postgresql function string_agg in JPA
In PostGreSQL, string_agg(column, separator) allows to aggregate some Strings. I try to use it with JPA but it is not a JPA standard function.
Note : This is not the equivalent of ...
0
votes
1answer
24 views
What is the encode(<columnName>, 'escape') PostgreSQL equivalent in java?
I have a bytea column stored in Postgresql db.
ColumnName:test
Ex: \x61736461640061736461736400
When I use encode(test,'escape') in my select query i get something like this.
Ex: ...
0
votes
0answers
42 views
How to read/write a boolean array in a Postgres database?
I have a postgres DB containing a table with a boolean array for the days of the week (t/f whether the employee has to work on this day or not).
The table is as follows:
CREATE TABLE employee(
...
1
vote
1answer
16 views
How could db schemas, implemented by Liquibase, be extended?
We have a product that we are looking to use liquibase to implement/re-factore the db schema. This then needs to be extended at the production site level that might have differences in the schema. ...
1
vote
0answers
18 views
Windows refuses postgres connection
I have a local network connecting 15 PCs. Every PC has postgres installed (8.3, 8.4, 9.2). Every database has the exact same installation parameters as name, user, password, etc.
I'm using a Java ...
0
votes
1answer
23 views
What algorithm or pattern to use to check what rows in what tables will be cascade deleted in mysql/pgsql?
So the question - I have a lot of tables in database and almost all of them have on delete cascade. What is the best way to inform user what will be deleted in entire database if he deletes one ...
0
votes
1answer
46 views
Why is the query not being recognized?
The code is to access a specific row within a column from a pgSQL table. I keep receiving an error that reads "You need to query() something first." However, I thought pgsql.query line would be enough ...
0
votes
2answers
25 views
How to Make Selection from Drop Down List Based on Previous Selection?
To make a simple illustration, assuming that I have a table in database which named as category and it consists only two columns which are cat_id and cat_description. Now, the question is how to make ...
0
votes
1answer
17 views
Getting org.postgresql.geometric.PGpoint instead of org.postgis.PGgeometry in Hibernate Spatial
I've been struggling with this for a while. Running on Tomcat 7.0.47
Relevant Entity Class snippet:
@Column(name = "geopoint", columnDefinition = "org.postgis.Geometry")
@Type(type = ...
2
votes
1answer
37 views
why hibernate on oracle jdbc fails when postgre driver is present in tomcat lib folder
I've installed in the same Tomcat7 alfresco and some of my applications that use hibernate.
In the lib folder I've ojdbc7.jar (for my apps) and postgresql-9.3-1100.jdbc41.jar for alfresco.
Adding the ...
0
votes
1answer
39 views
Hibernate/JDBC hanging when connecting top PostgreSQL 9.3.1 on Amazon RDS
Last thing shown in logs is :
2013-12-01 19:40:00,454 DEBUG localhost-startStop-1 org.hibernate.engine.jdbc.internal.JdbcServicesImpl - Database ->
name : PostgreSQL
version : 9.3.1
...
1
vote
1answer
46 views
Execution time of a Prepared statement's executeQuery() method vs. corresponding Stored procedure execution time
I have some middleware java code running on a Server machine that calls a Stored procedure insertMessageOne in a Postgresql database (9.1) on a remote machine.
PreparedStatement sendOne = ...
2
votes
1answer
43 views
Concept design for a MMO java engine
We are building a HTML5 MMO that will leverage AJAX calls to a REST API written in Python for actions ( buy, sell, build, trade, send , attack).
Our second part of this project is a Java Server that ...
0
votes
1answer
21 views
Password Hash validation/checking in DBMS vs. Web-app layer
I have the ability to do password hashing in the Web-app layer of my system or in the DBMS (postgresql's pgcrypto). Is there any advantage to using either or?
For more context, I will be using ...
0
votes
0answers
20 views
BIT(1) HIbernate JPA mapping
In Postgresql I have a column with type BIT(1). In JPA mapping it's like:
@Column(columnDefinition="bit(1)")
private String type;
But, when I perform tests, this error occurs:
ERROR: column "type" ...
1
vote
1answer
45 views
Exception : Callable statement did not return any value
I have written a java code to call a stored procedure which returns some data. Following is the code -
CallableStatement callableStatement = null;
List<OutputDTO> outputDTOList = new ...
0
votes
0answers
48 views
Column index out of range when creating alias with criteria
Ok so I get this weird issue that I can't fix.
I have 3 entities ( i will write things that only matters imo)
@Data
@Entity // all @ are in javax
@Table(name = "a", schema = "pl")
...
-2
votes
1answer
25 views
how to check which ip address accessing my database on 5432 port [closed]
i want to monitor my postgres database running on 5432 port. i want to see which ip address is accessing this at what time using java. How to do this?
0
votes
1answer
39 views
postgres migration error; unterminated dollar-quoted string
Well this is abit strange, could anyone help me point out where this function may be wrong.
I have a function similar to
CREATE FUNCTION check_password(uname TEXT, pass TEXT)
RETURNS BOOLEAN AS $$
...
0
votes
0answers
28 views
liferay: create a table during run time
Description : i am trying to edit the web form portlet. But by default it store the values in expando tables but i want to store it in new table.
but again i want keep this portlet as flexible as ...
0
votes
1answer
48 views
Application is getting stuck at hibernate txOracle.commit();
try {
sessionOracle = BaseDAO.getHibernateSession().openSession();
sessionPostgres = BaseDAOgis.getHibernateSession().openSession();
int id = 0;
JSONArray jaRoute = new ...
0
votes
0answers
26 views
Multiple access to the same shared database postgres sequence
I have two different java web application than access a shared postgres database for reading and writing.
My first web application in deployed on apache tomcat and my second web application is ...
1
vote
1answer
42 views
String interning in the database
I am using a PostgreSQL database to log various aspects of a long-running system I have and one particular item I am logging is the CLASSPATH of the various sub-ordinate processes the system spawns .
...
0
votes
1answer
37 views
Switching between MongoDB and JPA (Postgres) in the same project
In our current project we use MongoDB. Recently there was a request to switch to Postgres.
We don't want to drop MongoDB and just migrate to Postges right away. It would be great to have some sort of ...
2
votes
0answers
38 views
How to pass a set of composite types (UDTs) in PostgreSQL using JDBC
We are migrating from Oracle to PostgreSQL Enterprise DB and we have a stored procedure that accepts table-like structure. We used STRUCT with Oracle and it worked very well. Now this table is ...
1
vote
0answers
29 views
Hardware sizing an application which runs fine on a laptop?
If an application already runs well on a laptop with a local webserver and db, how does it impact hardware sizing for when it is deployed into product?
We're piloting this application for the first ...
-2
votes
0answers
54 views
How to retrieve data from database in java? [closed]
I have an Excel.java class which has database connections and my task is that i need to retrieve data from database to whatever query i write !! So i created an jlabel.java class in the same package ...
0
votes
3answers
56 views
Java SQL query execution, problems in reading the ResultSet rows
I'm writing simple Java code and I have to execute an SQL query on my Postgresql database.
The result of this database (I've checked manually) is a simple table made by one column and two integer ...
0
votes
1answer
17 views
Access to the original query through SQLWarning
I was wondering if there's a way to access the original SQL query from a SQLException/SQLWarning. I thought that that was unlikely, but the sentence Warnings are silently chained to the object whose ...
4
votes
1answer
84 views
Hibernate Spatial - 'Invalid endian flag value encountered' Exception
I'm trying to run a simple query in Hibernate Spatial 4.0 on PostgreSQL 9.3. I have a number of objects in a table with latitude/longitude values, and I'm trying to query objects that fall within a ...
0
votes
0answers
24 views
Parse postgres object literals
I'm working on a java/postgres project, and one of the db tables contains a fairly complex composite type. The project uses Ebean for O/R mapping, and I'm trying to map an ebean class to the table in ...
0
votes
1answer
69 views
Postgres DB can't connect to R with RJDBC
I've been trying to query data from a PostgreSQL DB via R. I've tried skinning the cat with a few different packages (RODBC, RJDBC, DBI, RPostgres, etc), but I seem to keep getting driver errors. ...
1
vote
1answer
78 views
Slow JBoss startup, possibly related to DataSource pointing to Heroku Postgres
I am observing a slow JBoss startup. Specifically there is a freeze in the startup when deploying my application, it seems during Hibernate initialisation:
22:43:00,066 DEBUG ...
0
votes
0answers
33 views
Android, take an entire row from postgreSQL database and put in a table or another structure
i'm new to Android programming but i made a little application that interacts with a postgreSQL database via JDBC e made things that aren't related to my question. My main question is: i have a table ...
1
vote
0answers
39 views
How do I log postgres driver messages with slf4j?
I'm using postgres db in my webapp.
I added following dependencies in my pom.xml:
<dependency>
<groupId>org.slf4j</groupId>
...
0
votes
1answer
54 views
Hibernate + PostgreSQL + Network Address Type (inet, cdir)
I have started my example project with Hibernate 4.2.7 and PostgreSQL 9.3.1 and everything is going well.
At the moment I would like to use INET PostgreSQL type but I am not able to map it with ...
0
votes
2answers
38 views
Using Hibernate to CREATE SCHEMA in PostgreSQL
All i want is to execute the following SQL on my PostgreSQL server after my Hibernate SessionFactory has been initialized:
CREATE SCHEMA IF NOT EXISTS "fooschema" AUTHORIZATION "foouser";
Currently ...
0
votes
0answers
24 views
How can Fix the TypeNotPresentExceptionProxy exception in java?
I am working in a java application and got the exception while migrating my users from postrgre sql db from mongo db getting the exception for the particular id,
2013-11-15 17:08:21,036 ERROR ...
0
votes
1answer
46 views
Storing Malformed Unicode Strings in Postgres
I want to store a string like following in one of my database tables:
ygei@kqmfNk@?w@Ac@l@}CbEoD|EM`@MLK@KCKS[e@W[[o@yAuCSUi@[G@KAII?MFk@?cAKWIQ?YFIDEd@cBzA}KvBuPX}B`BwLt@iFFEzE}AlDaA|JqC@y
This is ...
2
votes
2answers
34 views
One hour discrepancy in UTC offset between Postgresql and Java
I have a java program that generates timezone values in the binary format expected by Postgresql's COPY command in binary format. The data is written to a binary file which I then insert into ...
1
vote
1answer
33 views
Postgres sql error code for insert statement
A insert statement is generated in my java program that results in an error given as :
ERROR: @20111@
SQL state: P0001
-- Executing query:
insert into C_OrderLine
(AD_Client_ID, AD_Org_ID, ...
0
votes
1answer
26 views
Postgresql server refuses connection despite authorizing it
I'm connecting to a Postgresql server (version 8.4) with a Spring application.
My connection parameters are:
<Environment name="/db/driver_class" value="org.postgresql.Driver" ...
0
votes
1answer
58 views
JDBC - select where column is NULL
I have a simple table in my Postgres 9.0 database:
create table test (id int not null, value int);
I have populated it with a few rows:
insert into test values (1, 1);
insert into test values (2, ...
0
votes
2answers
110 views
unable to create new database with flyway
Question: Is it possible to create a new DB in a migration script and then connect to it? How?
My Scenario:
I'm trying to use flyway in my Java project (RESTful application using Jersey2.4 + tomcat 7 ...
2
votes
2answers
86 views
PostgreSQL JDBC getGeneratedKeys returns all columns
I've recently switched from MySQL to PostgreSQL for the back end of a project and discovered some of my database proxy methods needed reviewing. To insert linked objects I use a transaction to make ...