postgresql 1 « postgresql « Java Database Q&A

Java Database Q&A
7.Data Type
9.Database Product
25.MS Access
39.stored procedure
Java Database Q&A » postgresql » postgresql 1 

1. Which JDBC jar should I use with java 1.5.0_16 and PostgreSQL 8.3.5?

Title says it all: Which JDBC jar should I use with java 1.5.0_16 and PostgreSQL 8.3.5?

2. JDBC postgres vacuum timeout

I'm trying to vacuum my Postgres database by running the following SQL instruction within Java: vacuum verbose analyze Sometimes it just seems to "hang" is there any clean way to abort the process? ...

3. Java conectivity with PostgreSQL

can some one please tell me how to connect java file to postgresql database (if posible wit code n explanation)

4. How to run shell script on remote machine from Java?

I'm creating a test which will perform some stress testing of the app which talks to a Postgres database. In order to make it replicable I'd like to recreate the database ...

5. Can PostgreSQL be used with an on-disk database?

Currently, I have an application that uses Firebird in embedded mode to connect to a relatively simple database stored as a file on my hard drive. I want to switch to ...

6. How do i read from database with J2ME?

I am busy with a project that requires me to read from a database and display certain results on mobile(J2ME). For example: I must list all customers in the database (SELECT ...

7. Design Patterns in Database Applications with Java (JEE / JSE)

I've been reading StackOverflow for quite a while now and I'm only now building the nerve to ask a question. I'm 20 years old and currently enrolled in college in IT ...

8. How to disable Postgresql messages translation

Is there a way to disable the Postgresql translation of messages? I´m running my appl and Postgresql on a pt_BR Windows machine and when a exception is thrown the error message ...

9. OSGI & Apache Commons-DBCP Classloading Issue

I inherited some code that is using the Apache commons-dbcp Connection pools in an OSGi bundle. This code works fine with Eclipse/Equinox OSGi version 3.4.3 (R34x_v20081215), commons-dbcp 1.2.2 and the postgres ...

10. org.postgresql.util.PSQLException: FATAL: sorry, too many clients already

hi im using postgresql database, I want to insert my datas into database,but whenever i run the server,it was display the following Error. Error:org.postgresql.util.PSQLException: FATAL: sorry, too many clients already How to solve ...

11. how to update xpath_table

Is there a way to update xpath_table in postgres or java

12. How to store Arraylist values into database in java?

I want to store the Arraylist values into database(postgresql database) in java.

ArrayList<String> ActiveProcess = new ArrayList<String>();
        ArrayList<String> InActiveProcess = new ArrayList<String>();
I want to ...

13. what's equivalent to Long data type in postgresql?

greetings all i want to know what's equivalent to Long data type in postgresql which i can retrieve in a long variable.

14. How would I use ExpectJ to call pg_dump (on PostgreSQL 8.4) in Java?

I've seen this problem many places, that is to say the problem with programmatically making backups from PostgreSQL. My solution is to use ExpectJ, but I'm having trouble getting my code ...

15. PostgreSQL JDBC - can drop but not recreate indexes

I've been searching for an answer, but no luck so far... I want to perform bulk operations on a database with potentially millions of records, reading the PostgreSQL guide: '13.4 Populating a ...

16. Multithreaded data processing hanging on PostgreSQL

I'm trying to use the 8 threads from my new processor to handle transactions on the PostgreSQL database. It have to process geographic data in PostGIS, what I already do with ...

17. How to do a backup from a Postgresql-DB via JDBC?

In our application, we've implemented an automatic DB migration triggered from within our code. Now we want to backup the existing DB before doing any migration. Can anyone explain how to ...

18. Using Java, I upload an image to postgres DB size is 4000. But when I download it, the size is 8000

Here is the latest code. I wanted to try something different but I am still getting the same results. I am using postgres DB and I created a column called file with ...

19. PostgreSQL joined tables with null condition variable

I've a problem with my sql query in PostgreSQL while I'm trying to join a lot of tables. In section 'WHERE' I've a few conditions where I'm comparing some id values, e.g.

operator.agent_id ...

20. Connecting to local instance of PostgreSql with JDBC

I have a running local instance of PostgreSql on a linux machine. When I use psql command from the shell I success to log in without any problem. I need to ...

21. Calculating the daily minimum balance

Let's say I have a table named transaction with transaction_date, deposit, withdrawal fields. There may or may not be transaction on a day but can have multiple transactions for each ...

22. how can we write data to a file from database function in postgresql?

i searched many ways but i didn't get the information about how to write the data to a file when call the database function (postgresql) in the java program.. please clarify ...

23. how to create a file using postgresql functions?

Possible Duplicate:
how to create a file using postgresql function call?
i want to create a text file when i call a postgresql function for first ...

24. What has changed between postgres jdbc 8.4 and 9 regarding bytearrays?

I'm running Mac OSX 10.6 with PostgreSQL 9.0. I wrote a simple Java application that insert an image in a bytea field and then query the same field to check it. The ...

25. Unable to connect to PostgreSQL

I am trying to access a table from PostgreSQL present in other machine. I am getting the following error.

Connection refused. Check that the hostname and port are correct and that the
postmaster ...

26. create xml from postgres

how can i create xml file from postgresql? i m new with this so help me.....

27. Connecting with PostgreSQL 8.2 using Java

When I'm connecting to my database (PostgreSQL 8.2) through JDBC it gives an error ClassNotFound and something related to drivers. How do I fix this?

28. Using postgres to store page/JS widget impressions

I have a Javascript widget that will be included on other websites. It displays information, identified by a few IDs. I'm planning on saving all the widget impressions (could be tens ...

29. Postgres UTF-8 clobs with JDBC

Postgres JDBC driver seems to not handle UTF-8 clobs correctly. When you retrieve the clob the characters are not correct (you get ? marks for non ascii characters). Supposedly this is a ...

30. java web service working with postgressql database

ok, my code is written in java, and i am really new to java, so i hope my explanations are correct: i have a java written web service that works with a ...

31. Can I copy a Postgresql Large Object on the db server?

I've got data in a large object, now I want to make a copy of it so I can append to it while keeping the copy of the original. Is ...

32. Javax.persistence with @Entity bean saving int[] as bytea problem (postgres)

In my current project i have an @Entity bean, with, among others, an int[] field, which should match an integer[] field in my postgres database.
However, upon persisting my object i get ...

33. How do I build a JSON object by using GSON from the geom id that I would get from postgresql?

Postgresql has a geom_id that is basically an id generated by the latitude and longitude of a point on a map. How do I use that id to create a JSON ...

34. Creating JDBC functions from corresponding WSDL

I am working on building a web service from scratch with JDBC for postgreSQL. thing is that the operations given in the wsdl file do not show the corresponding database relation ...

35. How to replace single quote in Java with Postgres?

How to replace single quote in Java with Postgres?

select * from where id in ('<45646300.KDSFJJSKJSDF95'fdgdfgdfgd>', 'fdgdfgdg');
I always use params like
select * from where id = ?;
But in this case i have ...

36. log4j postgres in jee

After many search on the subject I finally think the solution of my problem is to ask you. So my problem is in the way to create logs on my web application ...

37. question about timezone in postgresql+java?

I am using postgresql9.0 and JDK6. I am running pg_controldata command in postgresql. in that I need "Time of latest checkpoint:" value. it is a date & time with timezone. while running through ...

38. PostgreSQL application access

I'm using JDBC to connect to a PostgreSQL database. We are trying to block access to the database for the users themselves; instead they should be forced to use our frontend. ...

39. Displaying image from PostgreSQL database, bytea

This code takes picture test.gif and puts the picture bit value into a bytea coloumn.

public void addImage() throws SQLException, IOException {
    Connection con = openConnection();


40. Java authentication/authorization server

I've been thrown in at the deep end a bit here, as I never expected I would have to do something like this and I have no idea where to start; ...

41. Creating an installer for Java program with database

Recently I made an application in using Swing, AWT and JDBC that manages some database. I used PostgreSQL as the backend with JDBC drivers to connect to the database. What I ...

42. Installing PL/Java on MAC

I’m really having trouble installing Pl/Java on Mac, any help would be appreciated. I’ll describe the exact steps I’ve done in accordance with the README here, but I still get ...

43. How to find the PostgreSQL installation folder via Java without user interaction?

In my Java application I want to implement the option to dump/restore a PostgreSQL database. Some google research showed me that calling pg_dump/pg_restore via Java's ProcessBuilder is probably the best way ...

44. In JDBC, how do I know when I am at the end of my FETCH?

I am following the example here And then looping the following command manually

in java. I have the above in an infinite loop and would like to ...

45. Display application name in Session Information when connecting via JDBC

I create a connection to a postgres 9 database using the stardard JDBC driver.

Connection myCon = DriverManager.getConnection("jdbc:postgresql://localhost/test?&user=test&password=test"); 
When I check the server status with PgAdmin and display all database sessions, I ...

46. Is a good idea do processing of a large amount of data directly on database?

I have a database with a lot of web pages stored. I will need to process all the data I have so I have two options: recover the data to the program ...

47. PostgreSQL view to read another table, transform data and return results

Could some please suggest the best way to implement this: Essentially what I want to have is a virtual-table in PostgreSQL that when queried, it looks up the data from some other ...

48. Problems with PlJava Function

I’ve been struggling with this problem a lot, and can’t figure out what’s going wrong. Consider very simple PlJava code shown below, in order to call some Java function:

public class Org {


49. java.lang.SecurityException: can’t read standard java class files

I’m implementing a function using the Pl/Java library, very similar to the one shown here: Now, everything works fine until I include some xpath code, see below:

import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import ...

50. How to correctly use setDate?

I have table with column "date" and type Date in format: "2011-09-06" and i want to execute query:

select * from tvprograms where date=?
And I try this:
Date startDate;
java.util.Date date;
Calendar cal = Calendar.getInstance();
cal.set(2011, 9, ...

51. XML data to PostgreSql database

What would be the best way to insert XML data ,that i get from webpage, into Postgresql database? Im using Java and need little help finding good way to read this ...

52. Problem with java app and hosted DBs

Some time ago, I started a new Java app wich function was to provide access to a remote DB, to browse, sort, filter and operate with some registers. To test it ...

53. Update methods for DAO?

Here I am trying to create a method for the update function. But this part of the code, which works successfully for delete method, is not working for update method. Can ...

54. JDBC to PostgreSQL Not working since upgrading Ubuntu

So I had PostgreSQL working in Ubuntu 11.04 using 8.4(?), however, when I upgraded it also upgraded PostgreSQL to 9.1 and now I can't connect using JDBC. I added the following to ...

55. Failover in postgresql9.0

I have setup Streaming replication. WAL receiver and sender process are running. I have made the entry for trigger_file in recovery.conf file. When I trigger failover, Its creating trigger file but failover didnt ...

56. compare a postgres and db2 table

normally i would solve this with a simple union. but this one has me. i have a table replicated to two different database engines. one copy in postgres, ...

57. Postgresql 8.4 occasional hang with JDBC access

I have a very database-intensive application which runs for many hours and uses multiple threads, all talking to Postgresql via JDBC. The symptom I'm seeing is that occasionally (one to ...

58. What is the best way to iterate and process an entire table from database?

I have a table called Token in my database that represents texts tokenized. Each row haves attributes like textblock, sentence and position(for identifying the text that the token is from) and ...

59. How can I create a PostgreSQL database in Java?

I have created a set of SQL queries that modify a database, and now I want to test them. How can I create a local and temporary PostgreSQL database to test my ...

60. Issue while build JasperServer with PostgreSQL Database

I am trying to customize the installation of JasperServer. I have downloaded the source. I have deployed successfully using MySQL database. I want to use PostgreSQL and remove the MySQL database. ...

61. java.lang.IllegalArgumentException: im == null?

I actually get the input source from PostgreSQL. The table column type is bytea. I want to convert the byte back to original image.

BuffredImage bImageFromConvert = ByteArrayInputStream(rsvalue.getBytes(10)));

ImageIO.write(bImageFromConvert, "jpg", new File("D:\\"+ ...

62. Large object streaming from PostgreSQL in JRuby?

How do I stream large objects from PostgreSQL in JRuby?

63. PostgreSQL JDBC Null String taken as a bytea

If entity.getHistory() is null following code snippet: (getEntityManager() returns spring injected EntityManager, database field history type is: text or varchar2(2000)

Query query = getEntityManager().createNativeQuery("insert into table_name(..., history, ....) values (?, ?, ?, ?, ...

64. Connect NB 6.9.1 to PostgreSQL 8.4 on remote server

Running NB 6.9.1 on XP box, PostgreSQL 8.4 on remote Ubuntu 10.04.1) box. PgSQL server is set up, and a blank database has been created. Attempting to register SQL server with: Host: jdbc:postgresql:// Port: 5432 This gives an error message "DatabaseException: Unknown host". But I can ping the host successfully with the same string. Ubuntu box IS enabled for remote access ...

66. SequenceGenerator Entity Class from PostgreSQL

Can netbeans 6.9 generate annotations for a SequenceGenerator for an entity class from PostgreSQL databse? Currently, I get this code: this code with annotation for entity class from a PostgreSQL database? @Entity @Table(name = "a_user") public class AUser implements Serializable { .... @Id @Basic(optional = false) @Column(name = "id") private Integer id; ... } But this code doesn't work with a ...

67. Java Application and Postgresql need help

Hello I'm new to both NetBeans and Java so i would realy appreciate the help. So I'm trying to connect to my Java Application (which is on Windows) a Postgresql database (which is on a virtual machine running Debian OS). The problem is even tough I've managed to link a table from the database to a Jtable when i run the ...

68. Re: Java Application and Postgresql need help

Hello ! I have the same error with Netbeans and Postgresql: Please help me! run: [TopLink Info]: 2011.03.09 04:23:32.102--ServerSession(9814147)--TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007)) [TopLink Info]: 2011.03.09 04:23:32.836--ServerSession(9814147)--file:/C:/Users/gesti/Documents/accessdoors1/build/classes/-accessdoorsPU login successful [TopLink Warning]: 2011.03.09 04:23:32.890--UnitOfWork(4300037)--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException Internal Exception: org.postgresql.util.PSQLException: ERROR: relation "public.doors" does not exist Error Code: 0 Call: ...

69. Reading postgresql.conf file using java

70. installing PostgreSQL

71. installing PostgreSQL on Windows 2000

72. PostgreSQL and JDBC

73. Java with postgresql

Hi, I am very new to postgresql. I have project which is working right now with Oracle,I need to make it work with Postgresql. For this, (1)What should I need to download(I mean what version of database & which driver. Do I need type 4 driver)? Please note that I have windows professional 2000 on my computer. Thanks, Angela

74. PostgreSQL on Windows without Cygwin

75. need advice from developers of smaller J2EE apps with PostgreSQL

We've been using a servlet/JSP app with a commercial database for a couple of years, but the db has been giving us trouble and we're thinking about moving, but what to we don't know. Right now, we just have a single Windows web server running Tomcat and a Linux server running our db. We're taking a hard look at PostgreSQL, but ...

76. postgreSQL on AS400

78. Connecting PostgreSQL through JDBC

Hi, I have written a JSP page and using PostgreSQL database.Now i want to connect to PostgreSQL using JDBC.I have used the driver : org.postgresql.Driver as Class.forName("org.postgresql.Driver"); con=DriverManager.getConnection("jdbc:postgresql://","username", "password"); I am not able to display the JSP page.I am getting the error as : java.lang.ClassNotFoundException: org.postgresql.Driver at org.apache.catalina.loader.WebappClassLoader.loadClass( at org.apache.catalina.loader.WebappClassLoader.loadClass( at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at project.mgs.MyDriver.getConnection( ...

80. how to fix size of table after accessing from postgresql

Database tables don't have a "size". At least, not one you can do anything about. The only "size" I can think of for a database table is the number of rows. But what's this "cell" thing you are asking about? It rather looks like you are asking about some form of display. Please provide more details so we can move this ...

81. Postgresql - exception

82. OutOfMemoryError while accessing Postgresql via JDBC

Hi all, I'm relatively new to Java and have the following problem with accessing a Postgresql database. I connect to the database and do a select, then iterate over the result set and build objects from the data. This works without a problem when the select returns only a few rows, but when I get a really large result (ca. 380,000 ...

83. connecting to postgresql

84. Problem with PreparedStatment and updatequery postgresql

Hi Folks, Im not sure whether this is the right place to post .Im facing a problem while using prepared statement along with the update query (I use Postgresql.).I've placed my code below, public DomainBean updateDB(DomainBean bean) throws Exception { Connection con = null; PreparedStatement stmt = null; ResultSet rs = null; DomainBean domainBean = new DomainBean(); int result = 0; ...

85. Using generatedKeys() with PostGRESQL

86. How to Escape single quotes with PreparedStatment while using PostGresql?

Hi All, I'm trying to write a preparedstatement query as below. String query= "SELECT count(*) over () as ROWCOUNT, CONSUMER_ID,WENEXA_ID,CONSUMER_NAME,CONTACT_NO,residing_village " + "from db_consumer " + "WHERE (lower(CONSUMER_NAME) LIKE (lower('%"+name+"%'))OR (lower('" + name + "')='')) " + "AND (lower(RESIDING_VILLAGE) LIKE (lower('%"+village+"%')) OR (lower('" + village + "')='')) " + "AND (lower(WENEXA_ID) LIKE (lower('%"+wenexaid+"%'))OR(lower( '" + wenexaid + "')='')) LIMIT '"+pageLimit+"'OFFSET '"+pageOffset+"'"; ...

87. Java client UI for PostgreSQL

Komo (Hawaiian for "enter") is a basic client user interface on which custom client UI applications can be built. It is customized for PostgreSQL but minor changes would allow it to be used with other client-server RDBMS systems. It includes basic program functions, advanced UI features (such as searchable help, welcome screen, splash screen, preference pages, wizards), database connectivity via JDBC, ...

88. Java method to convert ORA-SQL to Postgresql??

i am faced with a decision of either a massive code overhaul or a nasty method/program to convert my Oracle based queries into a Oracle9i / Postgresql friendly manner. the issue- all my code was initially written against oracle7, oracle8i using sql queries that ran in these databases, for clients that used them. honestly, there is over a couple hundred thousand ...

89. Postgresql character set problem - chars show up as ?

I'm using Postgresql 7.2, Tomcat 4.1.24, JDK1.4.2 on Linux. I set the charset to SQL_ASCII in the connection string for the JDBC driver. This used to work on Tomcat 4.0.3 and JDK1.3.1. The database contains characters like the copyright sign, and the funny upside-down quotes that MSWord uses. These now display on the site as ? instead of the correct characters. ...

90. MS Project and PostgreSQL

Hello, I need some help. I have installed SQL code to add PostgreSQL support to MS Project from MS Project can write data to PostgreSQL but when read project data, every fields containing date/time (eg task_start_date, task_stop_date) are not read. MS Project inserts in this fields default date/time. I have checked that in database all data/time fields are witten correctly ...

91. JDBC - Postgresql

I am trying to access a PGSQL DB via JDBC and have had no success. My environment is as follows: RH9 (kernel 2.4.20) j2sdk1.4.2_01 PostgreSQL 7.3.4 I have tried accessing the DB via the app provided by PGSQL with no success. Any other attempts with other java progs does not work either. The URL's that have been tried so far ...

92. Looking for PostgreSQL libraries - Type 2 JDBC or JNI

Hi I'm looking for a way to write a java program which can access a PostgreSQL databse. The catch is the database only has unix domain sockets. I'm specifically avoiding opening up TCP sockets as that will cause a lot of complication with authentication. Before I dive into JNI myself, is anyone aware of an existing PostgreSQL driver for java (JDBC ...

93. help with jdbc for postgresql

95. Show data from PostgreSQL

Hi there .. Im new in java ... i want to show some data from a data base that it was create en postgresql. Im using a framework that is called ZK i made my model of my page with this framework. Now i create a class to connect Postgre with Java ... but now i don't now what to do! ...

96. Postgresql + Types.BOOLEAN

97. problem in connecting to postgresql

Hi I am trying to connect java to postgresql. my code is working fine on RHEl4 but there is problem on Fedora core 4. i am not able to understand what could be the reason. All my settings are same as i did on linux. the exception came is Invalid argument or cannot assign Can anyone plz help??? its very ...

98. Connecting to postgresql db through netbeans problem

I've got Netbeans 5.5 with Postgresql 8.1.5 installed. I'm using the postgresql-8.1-408.jdbc3.jar file to connect to my Postgesql db. It does connect and allows me to create new tables, but it never shows the tables which are in that database. This works for Mysql fine, but not Postgresql, is there some switch or something I've forgotten to set? How can I ...

99. help regarding socket and postgresql

here's my dbConnect.class: /* * * * Created on November 14, 2006, 5:06 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ /** * * @author darkoasis */ package csfwdbillingmodules; import; import; import; import; import; import; import; import; import; ...  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.