title: Connecting a GUI to the User-Created function in postgresql-8.4.15
body: <p>I have been given a task to create profiles for the applications. The Database that we use is Postgresql. I've defined some function that will give me those profile and I've added them to the Postgresql source code. Now I don't know how to call those functions with a GUI. I mean how connect my Graphical user interface to those functions that I've created. For example I have a button in my GUI that is "Start creating profiles" and it's supposed to call those functions in postgresql source code code and so on...</p>
  
  <p>Any ideas of how to call those function from my GUI?</p>
  
  <p>I deeply appreciate your kind help in advance!</p>
  
  <p>Based on the replies, in order to use the JDBC to connect my GUI to postgreSQL, I wrote this code but I have a problem with "URL"</p>
  
  <p>I know these commands in Java to connect to database(PostgreSQL):</p>
  
  <pre><code>Connection con = null;
  Statement s = null;
  
  String url = "jdbc:postgresql://localhost/mydb";
  String user = "user";
  String password = null;
  
  try {
  con = DriverManager.getConnection(url, user, password);
   } catch (SQLException ex) {
             Logger lgr = Logger.getLogger(Home.class.getName());
             lgr.log(Level.SEVERE, ex.getMessage(), ex);
             out.println(ex.getMessage());
  } 
  
  String query = " select * from my_function()";
  try {
         s =con.createStatement();
         r = s.executeQuery(query);
  }catch (Exception e){
  }finally {
   try {
   if (con != null) 
  con.close();
    } catch (SQLException ex) {
                Logger lgr = Logger.getLogger(HomeServlet.class.getName());
                lgr.log(Level.WARNING, ex.getMessage(), ex);
  }
  </code></pre>
  
  <p>But I'm not sure about what I have to insert in "URL"
  Would you please help me with that!</p>