X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DDCA1D1B525 for ; Fri, 24 Oct 2003 21:31:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 69792-10 for ; Fri, 24 Oct 2003 18:30:46 -0300 (ADT) Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by svr1.postgresql.org (Postfix) with ESMTP id 60F23D1B541 for ; Fri, 24 Oct 2003 18:30:43 -0300 (ADT) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.12.3/8.12.3/Debian-6.6) with SMTP id h9OLUW5f004200; Fri, 24 Oct 2003 16:30:36 -0500 Reply-To: From: "Nick Fankhauser" To: "Mike Kenny - CPX Mngd Services" , "JDBC (E-mail)" Subject: Re: No suitable driver Date: Fri, 24 Oct 2003 16:30:08 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/95 X-Sequence-Number: 8525 Mike- It looks to me like your URL for the connection is malformed. It should be one of the following: jdbc:postgresql:databasename jdbc:postgresql://host/databasename jdbc:postgresql://host:port/databasename Take a look at this FAQ for more (There is also a "helloworld" example that may be useful in the FAQ): http://www.fankhausers.com/postgresql/jdbc/#nosuitabledriver -Nick -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org]On Behalf Of Mike Kenny - CPX Mngd Services Sent: Thursday, October 23, 2003 4:55 AM To: JDBC (E-mail) Subject: [JDBC] No suitable driver My code is quite simple try { Class.forName("org.postgres.Driver"); } catch(ClassNotFoundException nfe) { nfe.printStackTrace(); } try { db = DriverManager.getConnection("jdbc:databasename", "id", "password"); } catch(SQLException se) { se.printStackTrace(); } on execution I receive a SQLException stating that there is no suitable driver This is my first time trying to connect to postgreSQL and I am stuck. Any advice appreciated (career change is not an option :-) Mike Kenny Principal Consultant Comparex Africa (Pty) Ltd Managed Services * e-mail: mike.kenny@comparex.co.za ( Tel(W): +27 (0)11 266-5703 È Cell: +27 (0)83 266-1437 NOTICE: This message and any attachments are confidential and intended solely for the addressee. If you have received this message in error, please notify Dave Gilbert at Comparex Africa (Pty) Ltd immediately, telephone number +27 (0) 11 266 5204. Any unauthorised use, alteration or dissemination is prohibited. Comparex Africa (Pty) Ltd accepts no liability whatsoever for any loss whether it be direct, indirect or consequential, arising from information made available and actions resulting there from.