我已经在 Websphere spplication 服务器中创建了数据源。但我想在我的 JPA 项目中使用它。我在 Websphere 环境中创建了 JPA 项目。我使用了以下方式来使用数据源。但它没有用。
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="DSDemo">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>com.nyl.ltc.auditlog.model.AuditLog</class>
<properties>
<property name="openjpa.ConnectionDriverName" value="oracle.jdbc.driver.OracleDriver" />
<property name="openjpa.connection.datasource" value="oracleDS" />
<property name="openjpa.jdbc.Schema" value="SMSCSRVC" />
</properties>
</persistence-unit>
</persistence>
错误
<openjpa-2.1.1-SNAPSHOT-r422266:1087028 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: <openjpa-2.1.1-SNAPSHOT-r422266:1087028 fatal user error> org.apache.openjpa.util.UserException: A connection could not be obtained for driver class "oracle.jdbc.driver.OracleDriver" and URL "null". You may have specified an invalid URL.
注意:数据源已创建并测试了连接。这是成功的。我使用 OpenJPA 作为 JPA 提供者。
请让我知道我哪里出错了,我该如何解决?