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

next() and PreparedStatement

From: "Mano lito" <mdelas(at)msn(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: next() and PreparedStatement
Date: 2001-08-28 11:13:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc


  We are developing a project using PostgreSQL 7.1.2 and JDBC drivers to
  exchange information with the database. Here is a piece of code to explain
  our problem:

  PreparedStatement pstmt;
  Connection connection;
  ResultSet rs = null;
  String query = new String( "SELECT count(*) FROM foo_table WHERE 
foo_code=?;" );
  pstmt = connection.prepareStatement( query );
  pstmt.setString( 1, foo );
  rs = pstmt.executeQuery( query );



  the next() method will cause a java.lang.NullPointerException
  when the ResultSet comes from a PreparedStatement!!! Is this problem
  originated by the JDBC driver? We downloaded it from
  but this error occurs again and again and in we see
  7.0.x drivers available but none 7.1 nor 7.1.2 exists...

  We'd appreciate any help you could give us.If your address is not the
  correct place to ask this questions please tell us.

  Thanks in advance.

Descargue GRATUITAMENTE MSN Explorer en


pgsql-jdbc by date

Next:From: chris markiewiczDate: 2001-08-28 11:38:40
Subject: RE: next() and PreparedStatement
Previous:From: chris markiewiczDate: 2001-08-28 11:13:01
Subject: RE: Fastpath error on solaris 2.8 pgsql 7.1.3

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