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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-jdbc by date

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