-1
votes
0answers
25 views

allow integer type datatype to store “1” or “0” values in postgresql 9.3

i am using ppas9.3 with hibernate3 and i want to store boolean values in to integer type field. for that i changed the dialect property of hibernate3.jar for postgresql and it's started returning "1" ...
0
votes
2answers
26 views

How to place PostgreSQL driver jar file on class path in eclipse?

While trying out JDBC program to connect to PostgreSQL database using eclipse it flagged an error saying java.sql.SQLException: No suitable driver found It was suggested to place the PostgreSQL ...
1
vote
1answer
34 views

Wrong encoding for Postgresql messages in JDBC

I have an application written in Java that connects to a Postgresql 9.3 database. The database I'm connecting to is created with UTF-8 enconding. The locale for the server where the database is ...
0
votes
1answer
23 views

Getting error during insertion of the data in postgresql 9.3

currently i am using PostgreSQL Professional Advanced Server (PPAS) 9.3 (a modified version of PostgreSQL 9.3). I'm trying to insert a row in to postgresql database and get the error: error log: ...
0
votes
1answer
48 views

Cannot load JDBC driver class 'com.postgresql.jdbc.Driver' [duplicate]

org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure HHH000342: Could not obtain connection to query metadata : Cannot load JDBC driver class 'com.postgresql.jdbc.Driver' I'm getting this ...
0
votes
0answers
24 views

“FATAL: the database system is shutting down” while creating connection to PostgreSQL

I am getting FATAL: the database system is shutting down errors while creating PostgreSQL JDBC connections to a PostgreSQL 9.2 server. The specific exception path I'm getting from JDBC is here: ...
1
vote
1answer
36 views

Closing Connection, PreparedStatement, and ResultSet all in one call

Is there anything wrong in closing my connection resources like this? I seem to still have idle connections in postgres running. public void doSomething(){ Connection con = null; ...
0
votes
2answers
30 views

Using SQL rollback after a test case, but the method being tested uses commit

I am trying to write a unit test for one of our app's database access methods. We have a dedicated test database (a periodic dump/copy of the live database). Normally each test case is run in a single ...
0
votes
1answer
40 views

How to use a list in JDBC

I need to retrieve data from 3 different tables. Initially i used "joins" in my query to get the result. One of 3 tables consists of large data which is making my program to run very slow. So, i have ...
2
votes
2answers
24 views

Storing/retrieving BYTEA and BLOB with Java/Scala: “java.sql.SQLFeatureNotSupportedException”

The situation is as follows: I'm trying to store/retrieve byte[] arrays and BLOBS in a PostgreSQL database. I'm using Scala Play with Anorm, but for dealing with BYTEA and BLOB's I've regressed to ...
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, ...
1
vote
1answer
30 views

Delete data from postgres database

I use postgres with jdbc and I would like to delete all data from database without dropping any tables!! I would like to insert data in database using this <jdbc:initialize-database ...
1
vote
2answers
34 views

In Slick is there a way to declar Tables without using a Specific JDBC Driver

In my persistence code all through out the tables, etc. I have the following import import scala.slick.driver.PostgresDriver.simple._ This is nice because it works, but this is a problem because ...
0
votes
1answer
42 views

Is there something like preparedStatement.setDefault()?

If I have a statement like: INSERT INTO foo (id, name, description, etc_a, etc_b) VALUES (?, ?, ?, ?, ?); It's passed into a PreparedStatement. Sometimes I want to specify an id, and sometimes I ...
0
votes
1answer
38 views

Configuring Postgres Driver (Connector) for tomcat7

I have been trying to get my jsp code having some postgresql queries to work. I don't know what seems to be the problem, whether it is a problem with the configuration of the jdbc Driver or there is a ...
-2
votes
1answer
42 views

java.sql.SQLException: No suitable driver when reading data from database

I'm trying to create a web application which retreive data from a postgresql database, and these are the configuration files : web.xml <?xml version="1.0" encoding="ASCII"?> <web-app ...
1
vote
1answer
66 views

H2 postgresql mode seems not working for me

Hi my application accesses Postgres database and I have many predefined queries(Rank,Parition,complex join etc) I fire against Postgres. Now I want to go for unit testing these queries behaviour with ...
0
votes
1answer
25 views

TCP keepalive not working

The situation: Postgres 9.1 on Debian Server Scala(Java) application using the LISTEN/NOTIFY mechanism to get notified through JDBC As there can be very long pauses (multipla days) between ...
0
votes
1answer
82 views

Use Prepared Statement with Dropwizard JDBI and PostgreSQL UUID column

Quick overview, I'm using the Java web framework Dropwizard and the PostgreSQL database to learn how to create API's. Dropwizard provides the JDBI JDBC wrapper to interact with the database. TLDR: ...
1
vote
3answers
45 views

is JDBC code tied for single database type?

Consider this scenario: During development, I want to use MySQL and in production I will be using derby. To get connection, I have this method from java tutorial : public Connection getConnection() ...
0
votes
0answers
32 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
22 views

Insertion of image in postgresql database

I've seen lot of topics about this subject but it does not work. This is my code : public void storeChart(JFreeChart chart, String x, String y, String comments) throws SQLException, IOException { ...
0
votes
1answer
23 views

I need to add values into postresql in java,

ALL funcions working, only adding is prob java trowing exception: org.postgresql.util.PSQLException: ERROR: syntax error at or near "(" Position: 157 at ...
1
vote
1answer
42 views

Persistence.createEntityManagerFactory() takes very long time to return

I am using Hibernate 4.2, JPA 2.0 & Postgres 9.2 The code gets stuck at Persistence.createEntityManagerFactory("peristence_unit_name"); On further investigation I found that Hibernate makes a ...
0
votes
2answers
42 views

Avoid duplicate username insertion into DB using Postgres and Wicket framework

Since I am new to this framework i am not getting proper examples, can anyone tell me how to avoid duplicate username insertion in to DB? I just selected the username from the DB and put it into the ...
0
votes
1answer
30 views

PostgreSQL: Transactions

I am writing a client in JAVA using JDBC. I want to execute a statement like so resultSet = statement.executeQuery("BEGIN; Delete from Table id=1 Delete from table2 id=1 COMMIT;"); Obviously the ...
0
votes
1answer
37 views

How to install PostgreSQL JDBC driver in JDeveloper?

I need to create connection to my DB (PostgreSQL) in JDeveloper by "Create Database Connection" GUI. I suppose "Connection Type" field should be "Generic JDBC". How can I add PostgreSQL JDBC driver (i ...
0
votes
1answer
33 views

How is java (jdbc) dealing with floating IPs?

I want to use a floating ip to access a postgresql database (with failover). I now have a small webservice connecting to the database and running queries against it (SELECT NOW();). This seems to work ...
1
vote
1answer
34 views

PostgreSQL executeBatch() slows down with time

I have a program, which writes lines like 'name1 name2 score' into table with a PreparedStatement with upsert. So I execute this statement lots of time, adding it to batch. Batch size is 100, when ...
1
vote
1answer
27 views

JDBC insert real array

I am attempting to insert a real array into a postgresql array: the table definition is: String sqlTable = "CREATE TABLE IF NOT EXISTS ccmBlock" + " sampleId INTEGER," ...
0
votes
1answer
50 views

Mule and JDBC Query Result

I am using mule to connect to a Postgres database server. I can't use the datamapper since I am using the community edition. The object to xml transformer is not giving a good formatted result. Any ...
0
votes
1answer
25 views

why Exception.getMessage() differs between postgres jdbc 8.3 and jdbc 8.4 versions? [closed]

I caught the Exception from postgres through Java Excetpion, but it brings different kind of message in the postgres jdbc 8.3 and 8.4 drivers... When I use Exception.getMessage() with 8.3 jdbc ...
0
votes
1answer
56 views

Connecting jhipster remotely to postgres

I'm trying to configure jhipster to work with heroku's postgres database. Here are my database parameters with credentials redacted: spring: profiles: dev datasource: ...
0
votes
1answer
44 views

how to query on postgresql view using Java / Vaadin?

I am trying to fetch data from a view in Postgres using Java/ Vaadin. But I get error that table do not have primary key. But Postgres donot support keys on view. Can someone help on how to do that ...
0
votes
2answers
89 views

Loading the Postgresql JDBC 4.1 driver

I want to connect to a PostgreSQL database using the JDBC 4.1 driver. I declared the following dependency in the pom.xml: <dependency> <groupId>org.postgresql</groupId> ...
-6
votes
2answers
42 views

postgresql 3 error: Can't connect the application to database

My error is: May 08, 2014 3:03:16 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [jsp] in context with path [/Licenta] threw exception ...
-1
votes
2answers
45 views

Connection error to postgresql via servlets

I am new to postgresql and JDBC.I am not able to figure out my mistake.I have filled in the port number,password and username correctly. My Code: package ieiPackage; import java.io.IOException; ...
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 ...
0
votes
1answer
30 views

Multiple DataSource instances

Is it less-than-ideal to have multiple DataSource instances when using JDBC? If I have a base class that has various subclasses that all use a single static instance of DataSource (if it matters, I'm ...
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) ...
2
votes
2answers
61 views

How to prevent injection when user is supplying an arbitrary SQL identifier?

I need to run LISTEN channel_name against a PostgreSQL database using JDBC, where channel_name is supplied by a user in a web app. channel_name can be any PostgreSQL identifier. I don't believe I ...
0
votes
1answer
459 views

The name of the driver class for the datasource is missing (Netbeans+ PostgreSql + Glassfish)

I'm trying to develop an ejb application using netbeans 8 on a postgres 9.2 db and glassfish 4 server. Once I created connection pool and JDBC resources in the glassfish admin panel, I'm not able to ...
0
votes
1answer
56 views

Postgres : No suitable Driver found for jdbc JAR File

My eclipse program is working fine. However, when I try to compile it into a JAR file, I get this error: java.sql.SQLException: No suitable driver found for jdbc:postgresql://10.0.0.19: ...
2
votes
2answers
202 views

How to speed up table-retrieval with MATLAB and JDBC?

I am accessing a PostGreSQL 8.4 database with JDBC called by MATLAB. The tables I am interested in basically consist of various columns of different datatypes. They are selected through their ...
0
votes
1answer
358 views

JDBC Unable to get managed connection

I have been experiencing some problems with a Web App recently, I have a MDB (HornetQ) setup that consumes health messages from a number of remote nodes (standalone Java applications), as we have ...
0
votes
1answer
50 views

JDBC COPY with ant

I have a project with Spring, Hibernate and PostgreSQL and have to use ANT to create schema with data: <sql driver="org.postgresql.Driver" ...
1
vote
2answers
43 views

Postgres trigger syntax

Using SQLFiddle, PostgreSQL 9.3.1. I am learning to define triggers in PostgreSQL, and after doing some research I've found out the following: Triggers in Postgres are different from MYSQL. Where in ...
1
vote
1answer
92 views

How to access context attribute in action class of Struts 1.x..?

Below is the action class execute method.. I have been trying to access the servletcontext attribute set by listener.. public ActionForward execute(ActionMapping mapping, ActionForm form, ...
0
votes
2answers
61 views

Select clause returns same value for different columns

I'm using native request to select data from two tables. When I execute my request on pgAdmin console, the result returned well, but when I execute request from my application, same value returned for ...