jdbc question

Поиск
Список
Период
Сортировка
От mr_hopkins@earthlink.net (Micheal H.)
Тема jdbc question
Дата
Msg-id 38840aea.7517991@news.earthlink.net
обсуждение исходный текст
Список pgsql-hackers
I got the pgsql jdbc drivers and their names were jdbc6.5-1.1.jar and
jdbc6.5-1.2.jar.  OK everything I've read refers to postgresql.jar


I've tried adding the location of the files to the class path as well
as renaming them, one by one to postgresql.jar and adding the file
name to the classpath.  Nothing seems to work.  Now I'm not a java pro
so perhaps something's wrong with my code or my understanding of what
to do with the .jar file(s).   Here's the code.....It compiles but
never gets past "Failed to load postgresql driver".  Would greatly
appreacieate any assistance........

import java.sql.*;

public class SelectApp {public static void main(String args[]) {    String url = "jdbc:postgresql://gina/testdb";
try {        Class.forName("postgresql.Driver");    }    catch(Exception e) {        System.out.println("Failed to load
postgresql
driver.");        return;    }    System.out.println("Loaded driver successfully");    try {        Connection con =
DriverManager.getConnection(url, "", "");        Statement select = con.createStatement();        ResultSet result =
select.executeQuery("select
* from cities");
        System.out.println("Got results:");        while(result.next()) { // process results one
row at a time            int key = result.getInt(1);            String val = result.getString(2);
            System.out.println("key = " + key);            System.out.println("val = " + val);        }
select.close();       con.close();    }    catch(Exception e) {        e.printStackTrace();    }}
 
}



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: [HACKERS] How to ignore system indexes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Is pg_dump still broken?