Search Postgresql Archives

Re: How to pass jsonb and inet arguments to a stored function with JDBC?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



​Please don't top-post.

On Tue, Jun 14, 2016 at 10:44 AM, Alexander Farber <alexander.farber@xxxxxxxxx> wrote:
Thank you, David -

    PreparedStatement st = mDatabase.prepareStatement("SELECT out_uid FROM words_merge_users(?::jsonb, ?::inet)");

seems to work. Is it ok to call setString() then below?
 
        String str1 = JSON.toString(users);
        String str2 = mSession.getRemoteAddress().getAddress().getHostAddress();
        st.setString(1, str1);
        st.setString(2, str2);
       
        ResultSet rs = st.executeQuery();
        while (rs.next()) {

            System.out.println(rs.getString(1));
        }
        rs.close();
        st.close();


​I don't understand the question...​

​David J.​


 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux