Re: postgresql.stat.result

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Minal <minalac(at)yes2etl(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: postgresql.stat.result
Date: 2005-08-03 06:38:03
Message-ID: 42F0664B.8010100@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Minal wrote:

> org.apache.jasper.JasperException: postgresql.stat.result

(this must be a fairly old driver, but..)

> sql="SELECT sp_login ('INSERT','admin','"+username+"','"+password+"')";
> //sql="INSERT INTO USERS (USERTYPE,USERNAME,PASSWORD) VALUES
> ('admin','"+username+"','"+password+"')";
> pStat=conn.prepareStatement(sql);
> msg=pStat.executeUpdate();

You must use executeQuery() to execute SQL that returns a result. Per
the JDBC javadoc, if you use executeUpdate() to run a query that returns
a ResultSet, the driver should throw a SQLException.

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-08-03 07:01:20 Re: postgresql.stat.result
Previous Message Minal 2005-08-03 06:05:27 postgresql.stat.result