There is a Postgresql database with the following stub function

 CREATE OR REPLACE FUNCTION net_train(terms text[], answer integer) RETURNS void AS $BODY$begin --this code is stub end;$BODY$ LANGUAGE plpgsql VOLATILE COST 100; ALTER FUNCTION net_train(text[], integer) OWNER TO postgres; 

It is necessary to call this function from the java program. Tell me how to do it (preferably with sample code).

  • hibernate? - Gorets
  • @Gorets, can I have a more detailed example of a call? (very necessary, java do not know deeply). - ivan89
  • ohh, well, then I don’t know, tell me what you need to do in more detail - Gorets
  • as I have already said, if in more detail, then the stub function will be called for a certain number of times in the for loop. How to call this function in a loop (I have no idea about the operators that allow to call this function in a java-program)? - ivan89
  • @Gorets why are you offering a hibernate teapot? He will die, but will not make it - easier through the usual JDBC - Barmaley

1 answer 1

JDBC in hand and forward. Dig to the side CallableStatement - an example of a Hindu code here

Update via the link is an example of a MySQL for Postgres code does not change except for the moment of connecting the JDBC driver for Postgres: