From: William Lai <wlai2768@gmail.com>
To: Becerra Lagos Ana Lilian <exabecerra@nt.entel.cl>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: java.lang.NoClassDefFoundError
Date: Tue, 18 Jan 2005 23:25:00 +0800
Message-ID: <41ED2A4C.3020703@gmail.com> (raw)
In-Reply-To: <3A568BC085A5794983C7118F1A27CDEC2C7C40@epmarexc03.Entelpcs.Entelcorp.com>
References: <3A568BC085A5794983C7118F1A27CDEC2C7C40@epmarexc03.Entelpcs.Entelcorp.com>
Hi,
Did you try,
java -classpath c:\path\to\pg73jdbc3.jar;. Example2
Have a nice day,
William
Becerra Lagos Ana Lilian wrote:
> Hi,
>
>
>
> Could you help me in my program JAVA with jdbc Postgre
>
> I have my simple code
>
>
>
> import java.sql.DriverManager;
>
> import java.sql.Connection;
>
> import java.sql.SQLException;
>
>
>
> public class Example2 {
>
> public static void main(String[] argv) {
>
> System.out.println("Checking if Driver is registered with
> DriverManager.");
>
>
>
> try {
>
> Class.forName("org.postgresql.Driver");
>
> } catch (ClassNotFoundException cnfe) {
>
> System.out.println("Couldn't find the driver!");
>
> System.out.println("Let's print a stack trace, and exit.");
>
> cnfe.printStackTrace();
>
> System.exit(1);
>
> }
>
> }
>
> }
>
>
>
> Then I execute :
>
> javac Example2.java
>
>
>
> Then I execute
>
> java Example2
>
>
>
> but I get
>
> Exception in thread "main" java.lang.NoClassDefFoundError: Example
>
>
>
> Wich is my error ?
>
> I copied pg73jdbc3.jar in my path
>
> C:\j2sdk1.4.1_07\lib\
>
> Its have org.postgresql.Driver
>
>
>
> Thanks advanted
>
> ana
>
> Este correo es dirigido solo a las personas que aparecen como
> destinatarios
> y puede contener información confidencial o privilegiada.
> Si usted recibió este correo por error, por favor notificar
> inmediatamente
> al emisor y elimine el correo original. Cualquier otro uso de este correo
> esta prohibido.
>
> ******************************************************************************************************
>
>
> This message is for the designated recipient only and may contain
> privileged or
> confidential information. If you have received it in error, please
> notify the sender
> immediately and delete the original. Any other use of the email is
> prohibited.
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: wlai2768@gmail.com, exabecerra@nt.entel.cl
Subject: Re: java.lang.NoClassDefFoundError
In-Reply-To: <41ED2A4C.3020703@gmail.com>
References: <3A568BC085A5794983C7118F1A27CDEC2C7C40@epmarexc03.Entelpcs.Entelcorp.com> <41ED2A4C.3020703@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