String escaping?

Поиск
Список
Период
Сортировка
Искать
От
David Nedrow
Тема
String escaping?
Дата
Msg-id
50899926-5B68-42EC-B126-75EBC7E38BF4@mac.com
Список
Дерево обсуждения
String escaping? David Nedrow <dnedrow@mac.com>
Re: String escaping? Heikki Linnakangas <heikki@enterprisedb.com>
Re: String escaping? Mark Lewis <mark.lewis@mir3.com>
Re: String escaping? Markus Schaber <schabi@logix-tt.com>
Re: String escaping? Vit Timchishin <tivvpgsqljdbc@gtech-ua.com>
Re: String escaping? Markus Schaber <schabi@logix-tt.com>
Are there any build-in JDK or JDBC (Sun or Postgresql driver)  
functions for escaping strings before inserting/updating in the DB?

Eg., I'm using the following PreparedStatement...

addNickname = con.prepareStatement("insert into infobot.nicknames  
(nickname, firstseen) values (?, to_timestamp(?))");

When providing the value via addNickname.setString(1, this.getString 
()), is there some way for me to be sure that the contents of the  
string I'm feeding to setString() are properly formed/escaped.

I'm basically looking for the Java equivalent of PHP's  
pg_escape_string() function...

http://www.php.net/manual/en/function.pg-escape-string.php

I was hoping to avoid writing my own escape method, but may have to  
as I have yet to find anything "off the shelf".

Any suggestions would be appreciated,

-David

В списке pgsql-jdbc по дате отправления
От: Dave Cramer
Дата:
От: Heikki Linnakangas
Дата:
Сообщение: Re: String escaping?
FAQ