Skip site navigation (1) Skip section navigation (2)

SQL Error JDBC

From: Administration <admin(at)isorintrade(dot)ca>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: SQL Error JDBC
Date: 1999-02-24 03:36:42
Message-ID: 36D373C9.CFFF0BCA@isorintrade.ca (view raw or flat)
Thread:
Lists: pgsql-interfaces
 I have postgresql running in linux on a network, and I have a sample
program in windows. When I run the following

java -classpath .;c:\jdk1.2\lib\postgresql.jar test

I get this error

sqlexception: no suitable driver

Any ideas??

Henry

Here's my code(i'm pasting it because it's short:)
---------------------------------------------------------------------------------------

import java.sql.*;


public class test {
    public static void main(String args[]) {
        String url = "jdbc:postgres95://isorintrade.ca:5432/ra";
        Connection con;
        String createString;
        createString = "create table COFFEES " +
                            "(COF_NAME VARCHAR(32), " +
                            "SUP_ID INTEGER, " +
                            "PRICE FLOAT, " +
                            "SALES INTEGER, " +
                            "TOTAL INTEGER)";
        Statement stmt;

        try {
            Class.forName("postgresql.Driver");
        } catch(java.lang.ClassNotFoundException e) {
            System.err.print("ClassNotFoundException: ");
            System.err.println(e.getMessage());
        }

        try {
            con = DriverManager.getConnection(url, "postgres",
"feb_1b42");
            stmt = con.createStatement();
            stmt.executeUpdate(createString);
            stmt.close();
            con.close();

        } catch(SQLException ex) {
            System.err.println("SQLException: " + ex.getMessage());
        }
    }
}


Responses

pgsql-interfaces by date

Next:From: Michael ZhangDate: 1999-02-24 04:29:13
Subject: Newbie interface Q: How to deal with date/time with libpq or ecpg?
Previous:From: Dr. Nisai WanakuleDate: 1999-02-23 23:23:19
Subject: Perl Procedural Language

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group