Обсуждение: Problem connecting to JDBC 7.0-1.2 driver

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

Problem connecting to JDBC 7.0-1.2 driver

От
"B.N.V. Raman"
Дата:
Hi..

I've installed JDK 1.2.2 from RPM's into my Red Hat 7.0 System which has
Postgresql 7.0.2 installed.

1. I've copied the jdbc7.0-1.2.jar file to the postgresql.jar file.
2. my classpath includes /usr/lib/pgsql/postgresql.jar
3. Whenever i run a java program to connect, i get an SQLException: No
Driver Found.
4. My postmaster is running with the -i option.

What could be the problem??

Thanks

Raman.


Re: Problem connecting to JDBC 7.0-1.2 driver

От
"Brett W. McCoy"
Дата:
On Fri, 30 Mar 2001, B.N.V. Raman wrote:

> I've installed JDK 1.2.2 from RPM's into my Red Hat 7.0 System which has
> Postgresql 7.0.2 installed.
>
> 1. I've copied the jdbc7.0-1.2.jar file to the postgresql.jar file.
> 2. my classpath includes /usr/lib/pgsql/postgresql.jar
> 3. Whenever i run a java program to connect, i get an SQLException: No
> Driver Found.
> 4. My postmaster is running with the -i option.
>
> What could be the problem??

What's the code you are using to connect with?

-- Brett
                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
MS-DOS must die!


RE: Problem connecting to JDBC 7.0-1.2 driver

От
"B.N.V. Raman"
Дата:
I tried both methods:

1. Class.forName("postgresql.Driver"); (in the code)

&

2. omitting the above code and trying: java -Djdbc.drivers=postgresql.jar

Thanks,
Raman.

> From: Brett W. McCoy [mailto:bmccoy@chapelperilous.net]
> On Fri, 30 Mar 2001, B.N.V. Raman wrote:
>
> > I've installed JDK 1.2.2 from RPM's into my Red Hat 7.0 System which has
> > Postgresql 7.0.2 installed.
> >
> > 1. I've copied the jdbc7.0-1.2.jar file to the postgresql.jar file.
> > 2. my classpath includes /usr/lib/pgsql/postgresql.jar
> > 3. Whenever i run a java program to connect, i get an SQLException: No
> > Driver Found.
> > 4. My postmaster is running with the -i option.
> >
> > What could be the problem??
>
> What's the code you are using to connect with?
>
> -- Brett


RE: Problem connecting to JDBC 7.0-1.2 driver

От
"Brett W. McCoy"
Дата:
On Fri, 30 Mar 2001, B.N.V. Raman wrote:

> I tried both methods:
>
> 1. Class.forName("postgresql.Driver"); (in the code)

You should be using org.postgresql.Driver here, shouldn't you?

Same for the command line:

-Djdbc.drivers=org.postgresql.Driver

There are examples of this in the source code distribution under
src/interfaces/jdbc

-- Brett
                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Memory should be the starting point of the present.


RE: Problem connecting to JDBC 7.0-1.2 driver

От
"B.N.V. Raman"
Дата:
You're right.. org.postgresql.Driver works! I didn't think to look in
src/interfaces...

Thanks a Million!!

Raman.

> From: Brett W. McCoy [mailto:bmccoy@chapelperilous.net]
> On Fri, 30 Mar 2001, B.N.V. Raman wrote:
>
> > I tried both methods:
> >
> > 1. Class.forName("postgresql.Driver"); (in the code)
>
> You should be using org.postgresql.Driver here, shouldn't you?
>
> Same for the command line:
>
> -Djdbc.drivers=org.postgresql.Driver
>
> There are examples of this in the source code distribution under
> src/interfaces/jdbc
>
> -- Brett


Re: RE: Problem connecting to JDBC 7.0-1.2 driver

От
Peter T Mount
Дата:
Quoting "B.N.V. Raman" <raman@myself.com>:

> I tried both methods:
>
> 1. Class.forName("postgresql.Driver"); (in the code)

7.0 and later it's "org.postgresql.Driver"

> 2. omitting the above code and trying: java
> -Djdbc.drivers=postgresql.jar

Nope, -Djdbc.drivers=org.postgresql.Driver

Peter

--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/