简体   繁体   中英

Take in a Java ResultSet the return from a plpgsql function

Here we don't have one select query to take with getString the variables.So how can i take the result from just a return ?

create or replace function takeSomething()
    returns text AS
    $$
BEGIN
    return 'Ok';
END;    
$$ LANGUAGE plpgsql;

Java code:

ResultSet result;
result=Pstatement.executeQuery("Select takeSomething()");
result.next();
ResultSet result;
result=Pstatement.executeQuery("Select takeSomething()");
result.next();
System.out.println(result.getString(1));

as with every other select statement.

BY –> a_horse_with_no_name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM