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 23BCE9DC833 for ; Wed, 18 Jan 2006 11:03:51 -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 60636-07 for ; Wed, 18 Jan 2006 11:03:55 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.201]) by postgresql.org (Postfix) with ESMTP id 955449DC81D for ; Wed, 18 Jan 2006 11:03:48 -0400 (AST) Received: by zproxy.gmail.com with SMTP id 14so1645392nzn for ; Wed, 18 Jan 2006 07:03:53 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=c+nhKU9Ns7gdJdgNVR4390MYImJvpKiE/4E+0XdAmuYv/bNAK/8kywpU7m6L19u50ftCIEXMUgsq5fPeg8AvvfsK7Ts1JEWlYaEZ1PhiS2ycHPZmdbAElWUP2lHCbZ4GAl/gp7DqNLtcO96NP4SWcyOVMtafoVxqqMnDO0T4DYU= Received: by 10.65.137.18 with SMTP id p18mr2613719qbn; Wed, 18 Jan 2006 07:03:53 -0800 (PST) Received: by 10.65.98.1 with HTTP; Wed, 18 Jan 2006 07:03:53 -0800 (PST) Message-ID: <821c2ab80601180703h3f4b362cl@mail.gmail.com> Date: Wed, 18 Jan 2006 13:03:53 -0200 From: Wagner To: pgsql-jdbc@postgresql.org Subject: PROBLEM WITH DRIVER LOAD MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1435_16929122.1137596633194" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.167 required=5 tests=[HTML_MESSAGE=0.001, SUBJ_ALL_CAPS=1.166] X-Spam-Score: 1.167 X-Spam-Level: * X-Archive-Number: 200601/84 X-Sequence-Number: 14535 ------=_Part_1435_16929122.1137596633194 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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, //when compile to bytecode the error message is: /* driver load fail Exception in thread "main" java.lang.NullPointerException at DB.DBAccess.connect(DBAccess.java:45) at DB.DBAccess.begin(DBAccess.java:81) at Simulator.main(Simulator.java:23) */ } String url =3D "jdbc:postgresql://localhost/projeto"; Properties props =3D new Properties(); props.setProperty("user","postgres"); props.setProperty("password","postgres"); try{ Connection con =3D DriverManager.getConnection(url, props); }catch(SQLException sql){} try{ statement =3D con.createStatement(); }catch(SQLException sql){} /*try{ con =3D DriverManager.getConnection("postgres:projeto:local= host", "postgres", "usuario1"); } catch(SQLException sql){} */ } If anyone have some idea about it thanks a lot, this is my last chance to solve this problem, i have tryed many other forms to solve this, but i still have the problem -- ****************************************************** "Ci=EAncia da computa=E7=E3o est=E1 t=E3o relacionada aos computadores quanto a Astronomia aos telesc=F3pios, Biologia aos microsc=F3pios, ou Qu=EDmica aos tubos de ensaio. A Ci=EAncia n=E3o estuda ferramentas. Ela estuda como n=F3s as utilizamos, e o que descobrimos com elas." (Edsger W. Dijkstra) ******************************************************* ------=_Part_1435_16929122.1137596633194 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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(&quo= t;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,
//when compile to bytecode the error message is:
/*
driver load fail
Exception in thread "main" java.lang.NullPointerException
    at DB.DBAccess.connect(DBAccess.java:45)
    at DB.DBAccess.begin(DBAccess.java:81)
    at Simulator.main(Simulator.java:23)
*/
        }
       
        String url =3D "jdbc:postgresql://localhost/projeto";         Properties props =3D new Properties()= ;
        props.setProperty("user",&q= uot;postgres");
        props.setProperty("password"= ;,"postgres");
               =
        try{
            Connection con =3D= DriverManager.getConnection(url, props);
        }catch(SQLException sql){}
       
        try{
            statement =3D con.= createStatement();
        }catch(SQLException sql){}

           
            /*try{
                con =3D DriverManager.getConnection("postgres:projeto:localhost", "p= ostgres", "usuario1");
            }
            catch(SQLException= sql){}
        */
       
    }
If anyone have some idea about it tha= nks a lot, this is my last chance to solve this problem,
i have tryed many other forms to solve this, but i still have the problem
--
******************************************************
"Ci= =EAncia da computa=E7=E3o est=E1 t=E3o relacionada
aos computadores qua= nto a Astronomia aos
telesc=F3pios, Biologia aos microsc=F3pios, ou Qu=EDmica aos tubos de ensaio. A Ci=EAncia n=E3o
estuda ferramentas. Ela estuda como n=F3s
as utilizamos, e o que de= scobrimos com elas."
       &nb= sp;            =             &nb= sp;      (Edsger W. Dijkstra)
**************************************************= ***** ------=_Part_1435_16929122.1137596633194--