Tag Archives: DataSource

Spring, BasicDataSource and OpenJPA

So you want to use Spring with commons BasicDataSource and OpenJPA? There is an interesting gotcha. Let’s start with just the DriverManager DataSource for comparison. In your spring context you define the datasource like this: 1 2 3 4 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="org.hsqldb.jdbcDriver" p:url="jdbc:hsqldb:hsql://localhost:9001/testdb" p:username="sa" p:password="" /> Then your EntityManager Factory: 1 2 3 […]

Posted in JPA, Spring Framework | Also tagged , , | 1 Response