Re: String escaping?

Поиск
Список
Период
Сортировка
Искать
От
Markus Schaber
Тема
Re: String escaping?
Дата
Msg-id
20061214115414.2cff1417@kingfisher.sec.intern.logix-tt.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>
Hi, Mark,

Mark Lewis  wrote:

> > You don't generally need to escape your strings if you're using 
> > PreparedStatements.
> > 
> The only exception to this rule is backslashes and (when using LIKE) the
> '%' and '_' characters.  Although if you're running 8.2 and turn the
> standard_conforming_strings setting ON then you don't need to worry
> about backslashes.

That sounds confusing.

I always thought that the Strings that I set with setString() don't
have to be escaped at all, the Driver will handle it transparently (by
either escaping for V2 protocol, or using BIND with the appropriate
encoding).

But, of course, when I have a String Literal in the source, I need to
add a layer of Java escaping for ", \, and some others.



Regards,
Markus


-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org
В списке pgsql-jdbc по дате отправления
От: Michael Paesold
Дата:
От: Vit Timchishin
Дата:
Сообщение: Re: String escaping?
FAQ