X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E6F569DC9E1 for ; Wed, 18 Jan 2006 11:37:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64507-07 for ; Wed, 18 Jan 2006 11:37:43 -0400 (AST) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id C2CA59DC9CE for ; Wed, 18 Jan 2006 11:37:35 -0400 (AST) Received: from mail.mnc.ch (62-2-77-205.business.cablecom.ch [62.2.77.205]) by svr4.postgresql.org (Postfix) with ESMTP id 5B6B55AF039 for ; Wed, 18 Jan 2006 15:37:40 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by mail.mnc.ch (Postfix) with ESMTP id 11BD6A82CB; Wed, 18 Jan 2006 16:37:33 +0100 (CET) Received: from mail.mnc.ch ([127.0.0.1]) by localhost (mail.test.lan [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 17265-01; Wed, 18 Jan 2006 16:37:32 +0100 (CET) Received: from meuh.mnc.lan (62-2-77-204.business.cablecom.ch [62.2.77.204]) by mail.mnc.ch (Postfix) with ESMTP id A53CAA82B5; Wed, 18 Jan 2006 16:37:32 +0100 (CET) Received: by meuh.mnc.lan (Postfix, from userid 1000) id DB4061835B4; Wed, 18 Jan 2006 16:37:30 +0100 (CET) To: Wagner Cc: pgsql-jdbc@postgresql.org Subject: Re: PROBLEM WITH DRIVER LOAD References: <821c2ab80601180703h3f4b362cl@mail.gmail.com> X-Hashcash: 1:20:060118:wagner.and@gmail.com::lVhyXxkHZnqH639z:000000000000000000000000000000000000000001NiJ X-Hashcash: 1:20:060118:pgsql-jdbc@postgresql.org::qSg5vXNb6VPOLxlM:00000000000000000000000000000000000005jJ From: Guillaume Cottenceau Date: 18 Jan 2006 16:37:30 +0100 In-Reply-To: <821c2ab80601180703h3f4b362cl@mail.gmail.com> Message-ID: <878xtd35tx.fsf@meuh.mnc.lan> Lines: 22 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: amavisd-new at mnc.ch X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200601/86 X-Sequence-Number: 14537 Wagner writes: > Hi, i'm new in jdbc and > my problem is, the driver doesn't load, > the code is: > > public static void connect(){ > try{ > Class.forName("org.postgresql.Driver"); > }catch(ClassNotFoundException cnfex){ > System.err.println("driver load fail"); > > //the problem is here, i don't know what library i need and what i need to > do with the classpath to this works, As documented in multiple places, you have to put the postgresql.jar in your classpath. This depends on your java environment, but generally you can achieve this by using the "-cp" argument to the "java" program you invoke. -- Guillaume Cottenceau