Re: Help with exception: java.lang.IllegalArgumentException:
В списке pgsql-jdbc по дате отправления:
| От | Oliver Jowett |
|---|---|
| Тема | Re: Help with exception: java.lang.IllegalArgumentException: |
| Дата | |
| Msg-id | 41FE884E.2040004@opencloud.com обсуждение исходный текст |
| Ответ на | Help with exception: java.lang.IllegalArgumentException: \0 not allowed (Venkatesh Babu <venkatbabukr@yahoo.com>) |
| Список | pgsql-jdbc |
Venkatesh Babu wrote: > I'm getting an exception > "java.lang.IllegalArgumentException: \0 not allowed" > while using '\0' terminated strings as parameters for > the PreparedStatement. May I know whether usage of > such strings is not permitted? I'm using the > PreparedStatement.setString(int parameterIndex, String > x) function to set the parameters and I get the > exception here. You can't use \0 in text types (text, varchar, char, etc); this is a limitation of the server and the server/client protocol. The driver is just catching it early so you don't see strange behaviour later. In general, you don't need to terminate Java strings with \0 at all. If you really do need to store a literal NUL, consider using a bytea column and PreparedStatement.setBytes() instead. -O
В списке pgsql-jdbc по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера