X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 86C11D1B1C9 for ; Wed, 23 Jun 2004 22:48:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 39776-05 for ; Thu, 24 Jun 2004 01:48:25 +0000 (GMT) Received: from ganymede.hub.org (u46n208.hfx.eastlink.ca [24.222.46.208]) by svr1.postgresql.org (Postfix) with ESMTP id 846EAD1B1AE for ; Wed, 23 Jun 2004 22:48:20 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 355E54D24B; Wed, 23 Jun 2004 22:48:26 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 30CD14CFC6 for ; Wed, 23 Jun 2004 22:48:26 -0300 (ADT) X-Return-Path: X-Received: from localhost ([unix socket]) by ganymede.hub.org (Cyrus v2.2.6) with LMTPA; Wed, 23 Jun 2004 11:13:23 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 28F594B90D for ; Wed, 23 Jun 2004 11:11:51 -0300 (ADT) X-Received: from mail.postgresql.org [200.46.204.71] by localhost with IMAP (fetchmail-6.2.5) for scrappy@localhost (single-drop); Wed, 23 Jun 2004 11:11:51 -0300 (ADT) X-Received: from svr1.postgresql.org ([unix socket]) by svr1.postgresql.org (Cyrus v2.2.5) with LMTPA; Wed, 23 Jun 2004 11:09:12 -0300 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C2809D1B21B for ; Wed, 23 Jun 2004 11:09:12 -0300 (ADT) X-Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43851-01 for ; Wed, 23 Jun 2004 14:09:07 +0000 (GMT) X-Received: from neouvielle.enseirb.fr (neouvielle.enseirb.fr [147.210.18.138]) by svr1.postgresql.org (Postfix) with ESMTP id A6AA0D1B199 for ; Wed, 23 Jun 2004 11:09:00 -0300 (ADT) X-Received: from grandgousier.enseirb.fr (daemon@grandgousier [147.210.18.146]) by neouvielle.enseirb.fr (8.12.10/8.12.10) with ESMTP id i5NE93Dv007888 for ; Wed, 23 Jun 2004 16:09:03 +0200 (MET DST) X-Received: (from nobody@localhost) by grandgousier.enseirb.fr (8.12.10/8.12.10) id i5NE9K24001808 for pgsl-jdbc@postgresql.org; Wed, 23 Jun 2004 16:09:20 +0200 (MEST) From: ALBERDI Ion X-Authentication-Warning: grandgousier.enseirb.fr: nobody set sender to alberdi@enseirb.fr using -f X-Received: from 193.253.191.14 ( [193.253.191.14]) as user alberdi@pop.enseirb.fr by www.enseirb.fr with HTTP; Wed, 23 Jun 2004 16:09:20 +0200 Message-ID: <1087999760.40d98f100eb07@www.enseirb.fr> Date: Wed, 23 Jun 2004 16:09:20 +0200 To: pgsl-jdbc@postgresql.org Subject: PoolingDataSource executeUpdate MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 193.253.191.14 X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at hub.org X-Spam-DCC: : X-Spam-Pyzor: ReSent-Date: Wed, 23 Jun 2004 22:48:20 -0300 (ADT) Resent-From: "Marc G. Fournier" Resent-To: pgsql-jdbc@postgresql.org ReSent-Subject: PoolingDataSource executeUpdate ReSent-Message-ID: <20040623224820.K82735@ganymede.hub.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200406/155 X-Sequence-Number: 10357 Hi everybody! First excuse me for my poor english, I'm not a native english speaker :-). I have problems with the ConnectionPooling Implementation of the 4.3 postgresql jdbc driver: (pg74.214.jdbc3.jar). I'm using the 4.3-1 postgresql server under windows 2000 with cygwin. There is my problem: I am trying to comunicate with this datasource from a web application(the web- server is websphere 5.1 and we use jsp,servlets...). First I cannot manage to configure the datasource so that the application takes it in account (with WSAD5.1 I configure a new datasource implemented by org.postgresql.jdbc3.Jdbc3PoolingDataSource and with the serverName dataBaseName,user,maxConnections and password properties set), I launch the server and during the execution I get an exception which says something like Driver cast exception this driver cannot be used as one phase. So I tried another thing, instead of configuring the datasource with the websephere interface I configure it with javacode (I know that I may not do that because the code results to be less portable). So there is my code: Jdbc3PoolingDataSource pgSource = new Jdbc3PoolingDataSource(); pgSource.setServerName("localhost"); pgSource.setDatabaseName(dbName); pgSource.setUser(userName); pgSource.setPassword(password); pgSource.setMaxConnections(numberOfMaxConnections); ds = (javax.sql.DataSource)pgSource; and to obtain a connection I do: Connection con = ds.getConnection. I launch the server and test it. All the select queries work well, but when I try to do the first update of the database: query = new StringBuffer(); query.append("UPDATE "); query.append(ServiceTable); query.append(" SET "); query.append(ServiceDescDocId); query.append(" = ?, "); query.append(ServiceHelpDocId); query.append(" = ? WHERE "); query.append(ServiceId); query.append(" = ?"); // Execute the query: psmt = con.prepareStatement(query.toString()); psmt.setString(1, ddId); psmt.setString(2, hdId); psmt.setString(3, svcId); numUpdates = psmt.executeUpdate(); What happens there is that with Connection Pooling the executeUpdate method always returns 0, and that the database is not upgraded. I'm currently forced to use the Jdbc3SimpleDataSource class (with this class the application runs perfectly) but I would like to use Connection Pools to improve the application's performances. Thanks for having read my mail until the end :)