From: Wagner <wagner.and@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: PROBLEM WITH DRIVER LOAD
Date: Wed, 18 Jan 2006 13:03:53 -0200
Message-ID: <821c2ab80601180703h3f4b362cl@mail.gmail.com> (raw)
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)
*******************************************************
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: wagner.and@gmail.com
Subject: Re: PROBLEM WITH DRIVER LOAD
In-Reply-To: <821c2ab80601180703h3f4b362cl@mail.gmail.com>
References: <821c2ab80601180703h3f4b362cl@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox