Skip site navigation (1) Skip section navigation (2)

PROBLEM WITH DRIVER LOAD

From: Wagner <wagner(dot)and(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: PROBLEM WITH DRIVER LOAD
Date: 2006-01-18 15:03:53
Message-ID: 821c2ab80601180703h3f4b362cl@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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 = "jdbc:postgresql://localhost/projeto";
        Properties props = new Properties();
        props.setProperty("user","postgres");
        props.setProperty("password","postgres");

        try{
            Connection con = DriverManager.getConnection(url, props);
        }catch(SQLException sql){}

        try{
            statement = con.createStatement();
        }catch(SQLException sql){}


            /*try{
                con = DriverManager.getConnection("postgres:projeto:localhost",
"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ência da computação está tão relacionada
aos computadores quanto a Astronomia aos
telescópios, Biologia aos microscópios, ou
Química aos tubos de ensaio. A Ciência não
estuda ferramentas. Ela estuda como nós
as utilizamos, e o que descobrimos com elas."
                                       (Edsger W. Dijkstra)
*******************************************************

Responses

pgsql-jdbc by date

Next:From: Guillaume CottenceauDate: 2006-01-18 15:37:30
Subject: Re: PROBLEM WITH DRIVER LOAD
Previous:From: Achilleus MantziosDate: 2006-01-18 14:37:54
Subject: Re: [PPOSTGRES][PSQL] Segmentation fault

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group