无法为连接 URL 'null'创建类 " " 的 JDBC 驱动程序



我正试图用myBatis连接到oracle数据库,它返回以下错误:

GRAVE: ERROR.nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null'
### The error may exist in com/iberdrola/persistence/dao/BusquedaDao.java (best guess)
### The error may involve com.iberdrola.persistence.dao.BusquedaDao.getResultadosBusqueda
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create JDBC driver of class '' for connect URL 'null'

我在tomcat server.xml 中有数据库配置

<Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" maxIdle="1" maxTotal="20" maxWaitMillis="-1" name="jdbc/nombreBD" password="pass" removeAbandonedOnBorrow="true" removeAbandonedTimeout="60" type="javax.sql.DataSource" url="jdbc:oracle:thin:@//IP:PUERTO/AWDD" username="user"/>

我不明白为什么它告诉我类等于"和url'null',当我看到的时候,如果我添加了这些设置。

我不知道我可能错过了什么,也不知道我做错了什么。

任何丢失的信息,我添加它没有问题。

提前谢谢。

您需要使用类似于下面提到的配置将Tomcat与iBatis集成:

<transactionManager type="JDBC" >
<dataSource type="JNDI">
<property name="DBJndiContext" value="jdbc/nombreBD"/>
</dataSource>
</transactionManager>

查看此以了解更多信息。

最新更新