Using INET types in prepared statements in Java?

Поиск
Список
Период
Сортировка
От LITTLE Nelson
Тема Using INET types in prepared statements in Java?
Дата
Msg-id 200706130558.l5D5wOl4031981@sprint2.tenix.com
обсуждение исходный текст
Ответы Re: Using INET types in prepared statements in Java?
Re: Using INET types in prepared statements in Java?
Список pgsql-jdbc

Hi,

 

I am trying to create a prepared statement in JAVA via JDBC and one of the parameters I need to set in the SQL statement is of type INET. As there is no setInet() method how do I pass in the INET value into the sql statement?

 

I have tried this:

 

"     WHERE b.ip = ?::inet"

 

But I get “org.postgresql.util.PSQLException: ERROR: cannot cast type character varying to inet”

 

I also tried

"     WHERE b.ip = ?"

 

And I get “org.postgresql.util.PSQLException: ERROR: cannot cast type character varying to inet”

 

I really want to use prepared statement as I have to run this SQL statement over and over and it is supposed to be more efficient.

 

Can anyone help?

 

Cheers,

Nelson

 

В списке pgsql-jdbc по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Error reporting issue in SimpleParameterList
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: Using INET types in prepared statements in Java?