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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to pass jsonb and inet arguments to a stored function with JDBC?
Date: 2016-06-14 14:56:49
Message-ID: CAKFQuwarYMn3joWnqX5tFvJzar0UZOgRzAH6y4Jqb=TrsJdZBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

​Please don't top-post.

On Tue, Jun 14, 2016 at 10:44 AM, Alexander Farber <
alexander(dot)farber(at)gmail(dot)com> 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.​


In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edson Richter 2016-06-14 15:02:12 Re: Index seems "lost" after consecutive deletes
Previous Message Alexander Farber 2016-06-14 14:44:43 Re: How to pass jsonb and inet arguments to a stored function with JDBC?