Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 514E39FBC1A for ; Thu, 26 Apr 2007 06:19:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 29064-01 for ; Thu, 26 Apr 2007 06:19:33 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from fmmailgate09.web.de (fmmailgate09.web.de [217.72.192.184]) by postgresql.org (Postfix) with ESMTP id 685D99FBB80 for ; Thu, 26 Apr 2007 06:19:33 -0300 (ADT) Received: from web.de by fmmailgate09.web.de (Postfix) with SMTP id C580E8FDC0A for ; Thu, 26 Apr 2007 11:19:31 +0200 (CEST) Received: from [213.187.89.34] by freemailng2704.web.de with HTTP; Thu, 26 Apr 2007 11:19:30 +0200 Date: Thu, 26 Apr 2007 11:19:30 +0200 Message-Id: <58958572@web.de> MIME-Version: 1.0 From: Stefan Zweig To: pgsql-jdbc@postgresql.org Subject: slow jdbc postgres connection Precedence: fm-user Organization: http://freemail.web.de/ Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/119 X-Sequence-Number: 16968 hi i have the following problem: when i execute the following query via pgAdminIII i get a result within 31ms Select version() result: PostgreSQL 8.1 if try to execute the same query using the jdbc-interface from a java-application the same query needs horrible 4756ms. my jdbc driver is 8.1-409 JDBC 3 my postgres version is 8.1.8 my JRE-Version: 1.5.0_07 Connection pgconnection = null; // Load the pgSQL JDBC driver String pgdriverName = "org.postgresql.Driver"; Class.forName(pgdriverName); // Create a connection to the "test" database String pgserverName = "10.100.6.245"; String pgdatabase = "test"; String url = "jdbc:postgresql://" + pgserverName + "/" + pgdatabase + "?characterEncoding=UTF8&useUnicode=true"; String username = "user"; String password = "password"; pgconnection = DriverManager.getConnection(url, username, password); ResultSet pgresultSet; Statement pgstatement; pgstatement = pgconnection.createStatement(); String pgquery; pgquery="SELECT version()"; long start=System.currentTimeMillis();//start time measurement pgresultSet = pgstatement.executeQuery(pgquery); long time=System.currentTimeMillis()-start;//end time measurement //time =4756ms pgconnection.close(); if i do the similar query on our mysql database, which is on the same local server, i get quick results, so the reason probably cannot be a slow intranet-connection any help would be appriciated. regards. stefan _______________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192