Uisng Procedures via JDBC

From: "Michaell Oxtoby" <michael(dot)oxtoby(at)viewgate(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Uisng Procedures via JDBC
Date: 2002-01-07 17:42:13
Message-ID: 1010425315.10638.0.nnrp-10.c2d9b4bd@news.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have a query about accessing stored procedures in Postgres via JDBC.

Currently if we have a "cardata" procedure which retrieves a set of data on
cars

we access it in the following manner:

Statement s1 = connection.createStatement( );

String query = "select cardata( )";

ResultSet results = s1.executeQuery( query );

This is very different from the standard way of calling a stored procedure
in JDBC which

looks more like:

CallableStatement s1 = connection.prepareCall("{ call cardata }");

ResultSet results = s1.executeQuery( );

I would like to know if there is a better way of calling stored procedures
than the one we

are using or whether there is a method that looks more like the second piece
of code.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2002-01-07 18:10:02 Re: Which date/paper pairs are NOT represented?
Previous Message Hunter, Ray 2002-01-07 17:14:13 Postgres vs. Redhat DB