Re: JDBC and inet type
| От | rob stone |
|---|---|
| Тема | Re: JDBC and inet type |
| Дата | |
| Msg-id | 1449229300.4000.3.camel@gmail.com обсуждение исходный текст |
| Ответ на | JDBC and inet type (Tim Smith <randomdev4+postgres@gmail.com>) |
| Список | pgsql-general |
On Fri, 2015-12-04 at 09:41 +0000, Tim Smith wrote: > Hi, > > When I use "preparedStatement.setString(5,ip);" to send values to a > stored function, it obviously gets sent to postgres as "character > varying". > > Postgres obviously complains loudly and says " Hint: No function > matches the given name and argument types. You might need to add > explicit type casts.". > > What is the appropriate workaround ? > > Thanks! > > Tim > > "preparedStatement.setString(5,ip);" will set parameter number five to the string held in the variable. That's what setString does. It expects a string to be passed. Your function's fifth IN argument needs to be defined as a "string". Within the function you will have to cast it to inet. HTH, Rob
В списке pgsql-general по дате отправления: