Received: from clio.trends.ca (root@clio.trends.ca [209.47.148.2]) by hub.org (8.9.3/8.9.3) with ESMTP id BAA18348 for ; Tue, 18 Apr 2000 01:25:10 -0400 (EDT) (envelope-from render@uswest.net) Received: from slkcpop3.slkc.uswest.net (slkcpop3.slkc.uswest.net [206.81.128.3]) by clio.trends.ca (8.9.3+Sun/8.9.3) with SMTP id AAA19127 for ; Tue, 18 Apr 2000 00:24:16 -0400 (EDT) Received: (qmail 1445 invoked by alias); 18 Apr 2000 04:24:17 -0000 Received: (qmail 1440 invoked by uid 0); 18 Apr 2000 04:24:15 -0000 Received: from c976674-a.saltlk1.ut.home.com (HELO uswest.net) (24.9.174.14) by slkcpop3.slkc.uswest.net with SMTP; 18 Apr 2000 04:24:15 -0000 Message-ID: <38FBE1B6.686BBA95@uswest.net> Date: Mon, 17 Apr 2000 22:16:54 -0600 From: Nick Rathke X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Postgresql JDBC errors Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200004/111 I an using Postgresql-6.5.3 with jdbc6.5-1.2 and jdk1.2.2 on redhat linux 6.2 . I have tried to check the jdbc link using JDBCtest.java. Here is the info. my classpath is CLASSPATH=/lib/jdbc6.5-1.1.jar JDBCtest.java /* This file is part of the tutorial in Chapter 3 of "Getting Started with Enhydra". It is not meant to be used in any other context. Simple program to test JDBC connectivity. Assumes you have created and populated a table called LE_TUTORIAL_DISCS in your database. Edit the connection string in the call to DriverManager.getConnection()/ */ import java.sql.*; public class JDBCTest { public static void main( String[] args ) { Connection con = null; Statement stmt = null; ResultSet rs = null; // Load the driver, get a connection, create statement, run query, and print. try { Class.forName("postgresql.Driver"); // Replace parameters below your database connection string, username, and password con = DriverManager.getConnection("jdbc:postgresql:dbtest" ,"appserver", "appserver" ); stmt = con.createStatement(); rs = stmt.executeQuery("SELECT * FROM LE_TUTORIAL_DISCS"); rs.next(); System.out.println("Title = " + rs.getString("title") + " -- Artist = " + rs.getString("artist")); } catch(ClassNotFoundException e) { System.err.println("Couldn't load the driver: " + e.getMessage()); } catch(SQLException e) { System.err.println("SQLException caught: " + e.getMessage()); } } } which gives me the errors: Exception in thread "main" java.lang.NullPointerException: at postgresql.jdbc2.ResultSet.getString(ResultSet.java:148) at postgresql.jdbc2.ResultSet.getString(ResultSet.java:531) at JDBCTest.main(JDBCTest.java:25) I don't know enough about Java or databases to make any sense of this. Any help would be great. Nick Rathke