JDBC - setting PG variables in URL

Started by Jan Bilekalmost 19 years ago2 messagesgeneral
Jump to latest
#1Jan Bilek
bilekj@gmail.com

Hi,
Is it possible to set any of postgre variables in JDBC conection URL?

Example:
"jdbc:postgresql://localhost:/dbname?pgvar1=value2&pgvar2=value2"

Is this or simular construction plausible? We tried it, but it didn't work.
OR - question could be put this way: How to set internal postgre variables
(like search_path etc.) from Java2 enviroment using JDBC?

Thanks for any hints.

Regards,
Jan

#2Joshua D. Drake
jd@commandprompt.com
In reply to: Jan Bilek (#1)
Re: JDBC - setting PG variables in URL

Jan Bilek wrote:

Hi,
Is it possible to set any of postgre variables in JDBC conection URL?

Example:
"jdbc:postgresql://localhost:/dbname?pgvar1=value2&pgvar2=value2"

Is this or simular construction plausible? We tried it, but it didn't
work. OR - question could be put this way: How to set internal postgre
variables (like search_path etc.) from Java2 enviroment using JDBC?

create a routine that the first thing it does on connect is use the
various SET commands that you need.

J

Show quoted text

Thanks for any hints.

Regards,
Jan

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly