Thread: Connection Class.forName

Connection Class.forName

From
Ricardo Javier Aranibar León
Date:
Hi list

I nedd your help I'm newbie in JDBC and my first problem is:
When I try to connect To DataBAse I have this problem:
   java.lang.ClassNotFoundException: postgresql.Driver
maybe I try with org.postgresql.Driver and error in ClassNotFoundException
I work with Linux Suse 7.2
I have installed:
    postgresql-jdbc-7.0.3-70
and I define my CLASSPATH, maybe in:
/usr/lib/pgsql/jdbc7.0-1.2.jar

my small program is:

import java.sql.*;

public class db {

   public static void main (Strings[] args){
       try{
            Class.forName("org.postgresql.Driver");
            //Class.forName("postgresql.Driver");
        }catch (Exception e){
            e.printStackTrace();
        }
   }

}

If somebody can help i will thankfull

Note: I from Bolivia and my enghish grammar isn't good but i can understand
:)

Regards,
Ricardo

_________________________________________________________________
MSN Fotos: la forma más fácil de compartir e imprimir fotos.
http://photos.msn.es/support/worldwide.aspx


Re: Connection Class.forName

From
Dave Cramer
Date:
Ricardo,

why not use the latest jdbc driver? What version of pg are you using?

also the driver doesn't work with gjc, what version of java are you
using?

Dave
On Tue, 2002-12-10 at 09:07, Ricardo Javier Aranibar León wrote:
> Hi list
>
> I nedd your help I'm newbie in JDBC and my first problem is:
> When I try to connect To DataBAse I have this problem:
>    java.lang.ClassNotFoundException: postgresql.Driver
> maybe I try with org.postgresql.Driver and error in ClassNotFoundException
> I work with Linux Suse 7.2
> I have installed:
>     postgresql-jdbc-7.0.3-70
> and I define my CLASSPATH, maybe in:
> /usr/lib/pgsql/jdbc7.0-1.2.jar
>
> my small program is:
>
> import java.sql.*;
>
> public class db {
>
>    public static void main (Strings[] args){
>        try{
>             Class.forName("org.postgresql.Driver");
>             //Class.forName("postgresql.Driver");
>         }catch (Exception e){
>             e.printStackTrace();
>         }
>    }
>
> }
>
> If somebody can help i will thankfull
>
> Note: I from Bolivia and my enghish grammar isn't good but i can understand
> :)
>
> Regards,
> Ricardo
>
> _________________________________________________________________
> MSN Fotos: la forma más fácil de compartir e imprimir fotos.
> http://photos.msn.es/support/worldwide.aspx
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
--
Dave Cramer <Dave@micro-automation.net>


Re: Connection Class.forName

From
Fernando Nasser
Date:
dave,

Dave Cramer wrote:
> Ricardo,
>
> why not use the latest jdbc driver? What version of pg are you using?
>
> also the driver doesn't work with gjc, what version of java are you
> using?
>

It does work.   See:

http://sources.redhat.com/rhug/

But we need a new version.  I will see what I can do.
In the meanwhile, the 7.1.2 driver RPM can be found at:

ftp://sources.redhat.com/pub/rhug/RPMS/i386/

Regards to all,
Fernando


> Dave
> On Tue, 2002-12-10 at 09:07, Ricardo Javier Aranibar León wrote:
>
>>Hi list
>>
>>I nedd your help I'm newbie in JDBC and my first problem is:
>>When I try to connect To DataBAse I have this problem:
>>   java.lang.ClassNotFoundException: postgresql.Driver
>>maybe I try with org.postgresql.Driver and error in ClassNotFoundException
>>I work with Linux Suse 7.2
>>I have installed:
>>    postgresql-jdbc-7.0.3-70
>>and I define my CLASSPATH, maybe in:
>>/usr/lib/pgsql/jdbc7.0-1.2.jar
>>
>>my small program is:
>>
>>import java.sql.*;
>>
>>public class db {
>>
>>   public static void main (Strings[] args){
>>       try{
>>            Class.forName("org.postgresql.Driver");
>>            //Class.forName("postgresql.Driver");
>>        }catch (Exception e){
>>            e.printStackTrace();
>>        }
>>   }
>>
>>}
>>
>>If somebody can help i will thankfull
>>
>>Note: I from Bolivia and my enghish grammar isn't good but i can understand
>>:)
>>
>>Regards,
>>Ricardo
>>
>>_________________________________________________________________
>>MSN Fotos: la forma más fácil de compartir e imprimir fotos.
>>http://photos.msn.es/support/worldwide.aspx
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


Re: Connection Class.forName

From
Ricardo Javier Aranibar León
Date:
Dave,

I work with Linux Suse 7.2 my version of pg is postgreSQL 7.0.3 compiled
with gcc2.95.3 and my version of java is java2-1.3-46 maybe I downloand
pg73jdbc3.jar and I can't connect to my database.

Regards,
Ricardo


>Ricardo,
>
>why not use the latest jdbc driver? What version of pg are you using?
>
>also the driver doesn't work with gjc, what version of java are you
>using?
>
>Dave
>On Tue, 2002-12-10 at 09:07, Ricardo Javier Aranibar León wrote:
> > Hi list
> >
> > I nedd your help I'm newbie in JDBC and my first problem is:
> > When I try to connect To DataBAse I have this problem:
> >    java.lang.ClassNotFoundException: postgresql.Driver
> > maybe I try with org.postgresql.Driver and error in
>ClassNotFoundException
> > I work with Linux Suse 7.2
> > I have installed:
> >     postgresql-jdbc-7.0.3-70
> > and I define my CLASSPATH, maybe in:
> > /usr/lib/pgsql/jdbc7.0-1.2.jar
> >
> > my small program is:
> >
> > import java.sql.*;
> >
> > public class db {
> >
> >    public static void main (Strings[] args){
> >        try{
> >             Class.forName("org.postgresql.Driver");
> >             //Class.forName("postgresql.Driver");
> >         }catch (Exception e){
> >             e.printStackTrace();
> >         }
> >    }
> >
> > }
> >
> > If somebody can help i will thankfull
> >
> > Note: I from Bolivia and my enghish grammar isn't good but i can
>understand
> > :)
> >
> > Regards,
> > Ricardo


_________________________________________________________________
MSN. Más Útil Cada Día http://www.msn.es/intmap/