Yon can call plpgsql functions from client applications using a select statement.

If you don't want to use that way, you can use CallableStatement, this is an example how to use:

import java.lang.*;
import java.io.*;
import java.util.*;
import java.sql.*;

public class PostgreSQLSPDemo{

public static void main(String args[]){
String sSQL;
String sDriver;
String sUrl;
Connection dbAgenda;
Statement cmAgenda;
CallableStatement spAgenda;
String sVal;
int x;
int iStatus;

try{
sDriver = "org.postgresql.Driver";
sUrl = "jdbcostgresql://xxx.xx.xx.xx:5432/dbtest";
Class.forName(sDriver);
dbAgenda = DriverManager.getConnection(sUrl, "usr", "xxx");
cmAgenda = dbAgenda.createStatement();
sSQL = "DELETE FROM AGENDA";
cmAgenda.executeUpdate(sSQL);
dbAgenda.commit();
sSQL = "{? = call spInsAgenda(?, ?, ?, ?)}";

for (x = 100; x <= 250; x++){
sVal = Integer.toString(x);
spAgenda = dbAgenda.prepareCall(sSQL);
spAgenda.registerOutParameter(1, Types.INTEGER);
spAgenda.setInt(2, x);
spAgenda.setString(3, sVal);
spAgenda.setString(4, "# " + sVal);
spAgenda.setString(5, "(656) " + sVal);
spAgenda.execute();
iStatus = spAgenda.getInt(1); // catch return value
dbAgenda.commit();
System.out.println("Status " + Integer.toString(iStatus));
} // for

dbAgenda.close();
}
catch(Exception e){
System.out.println("Error:");
System.out.println(e.getMessage());
} // Exception
}

}