Skip to content

Setting session variables like SYNCHRONOUS_COMMIT in connection url #2900

Closed Answered by davecramer
pct960 asked this question in Q&A
Discussion options

You must be logged in to vote

From the docs https://jdbc.postgresql.org/documentation/use/

Properties props = new Properties();
props.setProperty("options", "-c search_path=test,public,pg_catalog -c statement_timeout=90000");
Connection conn = DriverManager.getConnection(url, props);

String url = "jdbc:postgresql://localhost:5432/postgres?options=-c%20search_path=test,public,pg_catalog%20-c%20statement_timeout=90000";
Connection conn = DriverManager.getConnection(url);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pct960
Comment options

Answer selected by davecramer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants