0

Reading the documentation on PostgreSQL documentation here I read the following:

As well, connections requested for users other than the default configured user are not pooled.

I couldn't find any more information on this. Who is the default configured user? Is it the user I logged in to the db with?

So in the following example:

Jdbc3PoolingDataSource source = new Jdbc3PoolingDataSource();
source.setDataSourceName("A Data Source");
source.setServerName("localhost");
source.setDatabaseName("test");
source.setUser("testuser");

the default configured user is testuser?

1 Answer 1

2

The default user is the one you set on the DataSource itself, however a DataSource has more than one method to obtain a connection:

  1. getConnection()
  2. getConnection(String username, String password)

The first method uses the (default) user configured on the DataSource. Based on the quoted documentation for the implementation you use, this method will provide a connection from the connection pool.

The second method takes a user name and password, and as indicated by the documentation you quoted that connection will not be pooled (except maybe if the username and password provided matches the default user of the DataSource).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.