[ https://issues.apache.org/jira/browse/OPENJPA-2372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alan Roche updated OPENJPA-2372: -------------------------------- Description: OpenJPA always invoked Datasource.getConnection(String username, String password) , - and defaults username and password to "root" where they are not configured via ConnectionUserName and ConnectionPassword. Datasource.getConnection() with no params is never called. Username and Password can be set in the JDBC connection URLs for most databases, so should not be defaulted. In this case getConnection() should probably be called Eg. In MySQL: jdbc:mysql://localhost/testdb?user=testuser&password=testpassord It is also possible to set the connection username and password in the JDBC URL We have a scenario where our customer configures a JDBC URL via a UI. To cut down on configuration and simplify configuration for the customer we only have a URL field (no username/password). To make it work we had to configure a custom datasource via "openjpa.ConnectionFactory" and override Datasource.getConnection(String username, String password) and invoke getConnection() therein with no params. was: OpenJPA always invoked Datasource.getConnection(String username, String password) , - and defaults username and password to "root" where they are not configured via ConnectionUserName and ConnectionPassword. Datasource.getConnection() with no params is never called. Username and Password can be set in the JDBC connection URLs for most databases, so should not be defaulted. In this case getConnection() should probably be called Eg. In MySQL: jdbc:mysql://localhost/testdb?user=testuser&password=testpassord It is also possible to set the connection username and password in the JDBC URL We have a scenario where our customer configures a JDBC URL via a UI. To cut down on configuration and simplify configuration for the customer we only have a URL field (no username/password). To make it work we had to override Datasource.getConnection(String username, String password) and invoke getConnection() with no params. > OpenJPA defaults datasource username and password to "root" where unset in > Config - cannot support username and password in JDBC URL only. > ------------------------------------------------------------------------------------------------------------------------------------------ > > Key: OPENJPA-2372 > URL: https://issues.apache.org/jira/browse/OPENJPA-2372 > Project: OpenJPA > Issue Type: Bug > Components: jdbc, slice > Affects Versions: 2.2.1 > Reporter: Alan Roche > > OpenJPA always invoked Datasource.getConnection(String username, String > password) , - and defaults username and password to "root" where they are not > configured via ConnectionUserName and ConnectionPassword. > Datasource.getConnection() with no params is never called. > Username and Password can be set in the JDBC connection URLs for most > databases, so should not be defaulted. In this case getConnection() should > probably be called > Eg. In MySQL: > jdbc:mysql://localhost/testdb?user=testuser&password=testpassord > It is also possible to set the connection username and password in the JDBC > URL > We have a scenario where our customer configures a JDBC URL via a UI. To cut > down on configuration and simplify configuration for the customer we only > have a URL field (no username/password). > To make it work we had to configure a custom datasource via > "openjpa.ConnectionFactory" and override Datasource.getConnection(String > username, String password) and invoke getConnection() therein with no params. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira