Обсуждение: CLASS EXCEPTION org.postgresql.Driver

Поиск
Список
Период
Сортировка

CLASS EXCEPTION org.postgresql.Driver

От
"Folorunsho, Abayomi"
Дата:

I just installed PostgreSQL 8.1.4.1 and created a dbase named HotelDB. I created tables using the dos (psql) prompt and very successful. The above exception came up when I tried to connect my application using JDBC:

 

Try{

 Class.forName("org.postgresql.Driver").newInstance();

 System.out.println("Class Found");

}

catch(ClassNotFoundException ey){System.out.println("CLASS EXCEPTION " + ey.getMessage());}

catch(InstantiationException ey){System.out.println("INSTANCE EXCEPTION " + ey.getMessage());}

catch(IllegalAccessException ey){System.out.println("ACCESS EXCEPTION " + ey.getMessage());}

                       

As advised, I copied postgresql-8.1-405.jdbc3.jar from C:\Program Files\PostgreSQL\8.1\jdbc to my class path and the name of the file included in my environment variable definition:

 

classpath\postgresql-8.1-405.jdbc3.jar;

 

when this did not work, I added the whole jdbc folder to my class path: C:\Program Files\PostgreSQL\8.1\jdbc

 

Since this did not work either I got this zip file ‘postgresql-8.1-405.jdbc3’ and unzip it in my class path and included this path in my environment variables. Still no solution.

 

Another question, I could not find the folder containing the newly created db(HotelDB) neither the database itself, though, as stated earlier I can work on it using the psql and the pgAdmin.

 

Please help

 

email: afolorunsho@cenbank.org

            afolorunsho@gmail.com

 

 

 


The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and or privileged material. Any review, retransmission, dissemination or other use or any action taken in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you receive this mail in error, please contact the sender and delete the material from your Computer system.

Re: CLASS EXCEPTION org.postgresql.Driver

От
Markus Schaber
Дата:
Hi, Abayomi,

Folorunsho, Abayomi wrote:
> As advised, I copied postgresql-8.1-405.jdbc3.jar from C:\Program
> Files\PostgreSQL\8.1\jdbc to my class path and the name of the file
> included in my environment variable definition:

> classpath\postgresql-8.1-405.jdbc3.jar;
> when this did not work, I added the whole jdbc folder to my class path:
> C:\Program Files\PostgreSQL\8.1\jdbc

Try giving the full path of the jar file to the -cp command line
argument to your JVM.


Alternatively, for most cases it works if you copy the jdbc.jar into the
lib/ext/ directory of your JRE/JDK.

HTH,
Markus


--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org