JAVA db client_java – 找不到类[org.apache.derby.jdbc.ClientDriver].尝试连接到db时

我在Netbeans中设置了一个项目,创建了一个脚本,用javadb建立了一个新的数据库.我可以通过gui连接到它 – 显示表内容等,但当我运行一个应用程序时:

EntityManager em = Persistence.createEntityManagerFactory("lab5PU").createEntityManager();

我得到这个很长的例外:

[EL Info]: 2013-04-05 21:40:45.554--ServerSession(1198260109)--EclipseLink, version: Eclipse Persistence Services - 2.3.0.v20110604-r9504

[EL Severe]: 2013-04-05 21:40:45.574--ServerSession(1198260109)--Local Exception Stack:

Exception [EclipseLink-4003] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.DatabaseException

Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: Exception [EclipseLink-4003] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.DatabaseException

Exception Description: Configuration error. Class [org.apache.derby.jdbc.ClientDriver] not found.

Exception Description: Configuration error. Class [org.apache.derby.jdbc.ClientDriver] not found.

at org.eclipse.persistence.exceptions.DatabaseException.configurationErrorClassNotFound(DatabaseException.java:82)

我可以在服务的驱动程序部分看到javadb驱动程序,所以我不知道错误是什么.

编辑:persistance.xml按要求:

org.eclipse.persistence.jpa.PersistenceProvider

lab5.Colleagues

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值