Re: postgresql.stat.result - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: postgresql.stat.result
Date
Msg-id 42F0664B.8010100@opencloud.com
Whole thread Raw
In response to postgresql.stat.result  (Minal <minalac@yes2etl.com>)
List 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

pgsql-jdbc by date:

Previous
From: Minal
Date:
Subject: postgresql.stat.result
Next
From: Oliver Jowett
Date:
Subject: Re: postgresql.stat.result