Thread: JAVA + JDBC + Postgresql

JAVA + JDBC + Postgresql

From
"Moses"
Date:
Hi all
I need your help
 
I did try to use the postgresql.jar  (jar tf ): 
 
import postgresql.fastpath;
 
but the package does not exist.
 
private void connectToDataBase(String User, String Password, String Url)
 {
  Statement stmt;
   try
   {
   // Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
   // Class.forName ("imaginary.sql.iMsqlDriver");
   Class.forName("org.postgresql.Driver");
Does postgresql has this driver? what do I need?
 
I'm looking forward to have your help.
 
 
Best Regards,
Moses (Mussie)
////////////////////////////////////////////////////////////////////////////
                 YOUR BRAIN IS HUNGRY
 Wireless COM Technology, News, and Opinion.
////////////////////////////////////////////////////////////////////////////

Re: JAVA + JDBC + Postgresql

From
Truong Hong Linh
Date:
I think you should do:

setenv CLASSPATH ${CLASSPATH}:/opt/local/pgsql/jdbc/postgresql.jar

Assume that PostgreSQL is installed in /opt/local. And then:

import java.sql.*;

Don't do

import postgresql.

It works with me.

Linh.
----

On Wed, 20 Jun 2001, Moses wrote:

> Hi all
> I need your help
>
> I did try to use the postgresql.jar  (jar tf ):
>
> import postgresql.fastpath;
>
> but the package does not exist.
>
> private void connectToDataBase(String User, String Password, String Url)
>  {
>   Statement stmt;
>    try
>    {
>    // Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
>    // Class.forName ("imaginary.sql.iMsqlDriver");
>    Class.forName("org.postgresql.Driver");
>
> Does postgresql has this driver? what do I need?
>
> I'm looking forward to have your help.
>
>
> Best Regards,
> Moses (Mussie)
> ////////////////////////////////////////////////////////////////////////////
>                  YOUR BRAIN IS HUNGRY
>  Wireless COM Technology, News, and Opinion.
> ////////////////////////////////////////////////////////////////////////////
>
>


Re: JAVA + JDBC + Postgresql

From
Martin Algesten
Date:
Your classpath must be wrong. There is no need to do an “import postgresql.whatever...” for doing ‘Class.forName(”org.postgresql.Driver”)’  <- Fully qualified class name, needs no import.

M

On 20/6/01 15:13, "Moses" <moses@kampsax.dtu.dk> wrote:

Hi all
I need your help

I did try to use the postgresql.jar  (jar tf ):
 
import postgresql.fastpath;

but the package does not exist.

private void connectToDataBase(String User, String Password, String Url)
 {
  Statement stmt;
   try
   {
   // Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
   // Class.forName ("imaginary.sql.iMsqlDriver");
   Class.forName("org.postgresql.Driver");
Does postgresql has this driver? what do I need?

I'm looking forward to have your help.

 
Best Regards,
Moses (Mussie)
////////////////////////////////////////////////////////////////////////////
                 YOUR BRAIN IS HUNGRY
 Wireless COM Technology, News, and Opinion.
////////////////////////////////////////////////////////////////////////////