0
我在學習JPAContainer,我無法理解如何配置我的SGBD連接...使用DAO模式創建一個返回我的連接的類。JPAContainer連接?
//ConnectionFactory DAO mode
public class ConnectionFactory {
public Connection getConnection() {
try {
return DriverManager.getConnection(
"jdbc:mysql://localhost/fj21", "root", "");
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
}
如何創建與JPAContainer一起使用的連接?有什麼更好的辦法
但配置我的方面,我需要的EclipseLink的?這些示例http://vaadin.com/download/jpacontainer-tutorial/正在使用EclipseLink,但我不知道如何配置它。我很迷茫:/ – FernandoPaiva
@FernandoPaiva我發現你對JPA沒有多少了解。看看這個教程:http://www.vogella.com/tutorials/JavaPersistenceAPI/article.html – nexus
哇,很好,我會做這個例子。謝謝 – FernandoPaiva