Обсуждение: jdbc driver not recognized

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

jdbc driver not recognized

От
Stuart Urban
Дата:
I have installed postgresql-7.0.2 on my IRIX 6.5.4 system and everything
works great, except for the JDBC driver.  I have made the driver and have
tried to add the .jar file to my classpath.  It looked as though it was
successful, but whenever I try to access the driver using the
Class.forName(org.postgresql.Driver) method, I get a
ClassNotFoundException.  Has anyone used postgres with Java that can give
me any hints?

--
Thanks,
Stuart Urban



Re: jdbc driver not recognized

От
wyrd
Дата:
Hi Stuart,


> I have installed postgresql-7.0.2 on my IRIX 6.5.4 system and everything
> works great, except for the JDBC driver.  I have made the driver and have
> tried to add the .jar file to my classpath.  It looked as though it was
> successful, but whenever I try to access the driver using the
> Class.forName(org.postgresql.Driver) method, I get a
> ClassNotFoundException.  Has anyone used postgres with Java that can give
> me any hints?
>

I've used the jdbc driver in a servlet rather effectively.

You might try doing something like:

    System.setProperty("jdbc.drivers","postgresql.Driver");
    Class.forName("postgresql.Driver");

This works for me with Postgresql 6.5.3, if the package name got
changed to org.postgresql you should probably try:

    System.setProperty("jdbc.drivers","org.postgresql.Driver");
    Class.forName("org.postgresql.Driver");


                        ~Rob

--
wYRd.:|:.wyrd@triskelion-nova.com.:|:.prohibitions void where offered
                      de recta non tolerandum sunt

Re: jdbc driver not recognized

От
Stuart Urban
Дата:
Hello Rob,

Thank you for responding to my e-mail concerning the jdbc driver included
in the PostgreSQL package.  Unfortunately, I am still having problems.
The 'System.setProperty' method you suggested does not exist(I am using
JDK 1.1.5, so maybe this is the problem, if you are using Java 2).  I
checked into Sun's documentation on the System and Property classes, and
it looks as though there is not a method in 1.1.x to set a single
property.  I have tried numerous different ways of getting JDBC to work.
First of all, the suggested 'export CLASSPATH'(given in the README file
with the jdbc stuff) command does not work on my machine.  If I do a 'set
CLASSPATH' to the proper .jar file, it makes the standard Java classes
unrecognizable to the system, and the 'setenv $ CLASSPATH' seems to do
nothing, even though it shows no errors.  I may just be working with a
weird system(I do not have access to all of the Java files because I am a
computer science student and the JDK is a shared application), so I will
try to find out if anyone around knows how to do this, but if you have any
more suggestions, I would appreciate it.

--
Thanks again for your time,
Stuart

On Tue, 11 Jul 2000, wyrd wrote:

>
> Hi Stuart,
>
>
> I've used the jdbc driver in a servlet rather effectively.
>
> You might try doing something like:
>
>     System.setProperty("jdbc.drivers","postgresql.Driver");
>     Class.forName("postgresql.Driver");
>
> This works for me with Postgresql 6.5.3, if the package name got
> changed to org.postgresql you should probably try:
>
>     System.setProperty("jdbc.drivers","org.postgresql.Driver");
>     Class.forName("org.postgresql.Driver");
>
>
>                         ~Rob
>
> --
> wYRd.:|:.wyrd@triskelion-nova.com.:|:.prohibitions void where offered
>                       de recta non tolerandum sunt
>


win Drivers for postgreSQL 7.0

От
igor
Дата:
Hello,

I'm trying to install postgresql 7.02 (now 6.4 release
working on my server ).
Tell me please is new ODBC drivers availible for v.7.02, and where
I can get it?



Thanks.

 igor                            mailto:igor_kh@mailru.com



Re: win Drivers for postgreSQL 7.0

От
Jacques Williams
Дата:
Igor,

The ODBC drivers should be in the source distribution, at postresql-7.0.2/src/interfaces/odbc.

You should be able to build the package by running ./configure --with-odbc from postgresql-7.0.2/src, or, if the
packageis already built, just run "make" and "make install" from the odbc directory. 

HTH,

Jacques


On Fri, Jul 14, 2000 at 08:10:30AM +0400, igor wrote:
> Hello,
>
> I'm trying to install postgresql 7.02 (now 6.4 release
> working on my server ).
> Tell me please is new ODBC drivers availible for v.7.02, and where
> I can get it?
>
>
>
> Thanks.
>
>  igor                            mailto:igor_kh@mailru.com
>
>

Re: jdbc driver not recognized

От
wyrd
Дата:
Hi Stuart,

Sorry abou the delay getting back to you.  In case you haven't
gotten any more info on this.  As it happens I do use Java 2.
It's been awhile since I've use 1.1.  One thing you might try
instead of using the System.setProperty() method is try the -D
option of the java command :

    java -Djdbc.drivers=<driver> <java class>

The jar containing the driver definitely has to be in CLASSPATH.
Setting this will depend on on which shell you are using.  From
below it looks like you're using csh or a csh variant.
You could try:
    set CLASSPATH <path to classes.zip>:<path to pqsl driver jar>

Note that the above pathes need to include the classes.zip and the
jar file.

Hope this helps.

                    ~Rob
Stuart Urban wrote:
>
> Hello Rob,
>
> Thank you for responding to my e-mail concerning the jdbc driver included
> in the PostgreSQL package.  Unfortunately, I am still having problems.
> The 'System.setProperty' method you suggested does not exist(I am using
> JDK 1.1.5, so maybe this is the problem, if you are using Java 2).  I
> checked into Sun's documentation on the System and Property classes, and
> it looks as though there is not a method in 1.1.x to set a single
> property.  I have tried numerous different ways of getting JDBC to work.
> First of all, the suggested 'export CLASSPATH'(given in the README file
> with the jdbc stuff) command does not work on my machine.  If I do a 'set
> CLASSPATH' to the proper .jar file, it makes the standard Java classes
> unrecognizable to the system, and the 'setenv $ CLASSPATH' seems to do
> nothing, even though it shows no errors.  I may just be working with a
> weird system(I do not have access to all of the Java files because I am a
> computer science student and the JDK is a shared application), so I will
> try to find out if anyone around knows how to do this, but if you have any
> more suggestions, I would appreciate it.
>
> --

--
wYRd.:|:.wyrd@triskelion-nova.com.:|:.prohibitions void where offered
                      de recta non tolerandum sunt