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

Postgresql JDBC errors

From: Nick Rathke <render(at)uswest(dot)net>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Postgresql JDBC errors
Date: 2000-04-18 04:16:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
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 Here is the info.

my classpath is


    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


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
  try {
   // 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");;
   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 JDBCTest.main(

I don't know enough about Java or databases to make any sense of this.
Any help would be great.

Nick Rathke

pgsql-interfaces by date

Next:From: Matthew DennyDate: 2000-04-18 05:06:41
Subject: getting OID of INSERTed record in ECPG
Previous:From: Thomas LockhartDate: 2000-04-18 03:28:11
Subject: Re: Using PGSQL via ODBC from within StarOffice ...

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