This page on Spring JDBC says
The DataSourceUtils class … provides static methods to obtain connections from JNDI
However the API doc for DataSourceUtils does not include the said static methods, as far as I can see.
What am I missing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hmm… Somehow, the Javadoc of
DataSourceUtilsis more “accurate” (I mean, the doc is not wrong but technically, you obtain a connection from a DataSource – that can be obtained via JNDI):And the following methods should be what you’re looking for:
DataSourceUtils.getConnection(DataSource)DataSourceUtils.getGetConnection(DataSource)Basic example (from the MySQL documentation):