Try putting the postgresql.jar file in the /jre/lib/ext/ directory...
Is possible to put the postgresql.jar file into another jar file (my app.jar) and use
them in my app?
Edson Richter
----------
From: Dustin Lang
Sent: terça-feira, 28 de dezembro de 1999 05:10
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Jar file with JDBC
Hi,
> try
> {
> Class.forName("postgresql.Driver");
> db = DriverManager.getConnection(url, usr, pwd);
> st = db.createStatement();
> }
> st.executeUpdate(crt);
> ^^^^^^^^^^^^^^^^^^^^^^^^
> //While executing this statement it gives nullpointer
It looks as though the driver can't create a statement, since
"st" is null. Are you sure you are including absolutely all the classes
required by all parts of your application and your jdbc driver? To test
this specifically, try putting all the classes you use in one base
directory, then set your path variables and make sure that classes are
being only loaded from there and rt.jar. Then jar that directory and see
what happens!
Another option might be turning on verbose class loading to see what's
happening.
Both these ideas should help to detect class loading, which by your
description sounds like the base of your problem, since it works out of
the jar.
Cheers,
dstn.
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]