无法为连接 URL 'null' 创建 class“”的 JDBC 驱动程序
Cannot create JDBC driver of class "" for connect URL 'null'
我正在尝试使用 myBatis 连接到一个 oracle 数据库,它 returns 出现以下错误:
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"/>
我不明白为什么它告诉我 class 等于 "" 和 url 'null' 当我看到时,如果我添加了这些设置。
我不知道我可能遗漏了什么或做错了什么。
任何遗漏的信息,我添加它没有问题。
提前致谢。
您需要使用类似于下面提到的配置将 Tomcat 与 iBatis 集成:
<transactionManager type="JDBC" >
<dataSource type="JNDI">
<property name="DBJndiContext" value="jdbc/nombreBD"/>
</dataSource>
</transactionManager>
查看 this 以了解更多信息。
我正在尝试使用 myBatis 连接到一个 oracle 数据库,它 returns 出现以下错误:
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"/>
我不明白为什么它告诉我 class 等于 "" 和 url 'null' 当我看到时,如果我添加了这些设置。
我不知道我可能遗漏了什么或做错了什么。
任何遗漏的信息,我添加它没有问题。
提前致谢。
您需要使用类似于下面提到的配置将 Tomcat 与 iBatis 集成:
<transactionManager type="JDBC" >
<dataSource type="JNDI">
<property name="DBJndiContext" value="jdbc/nombreBD"/>
</dataSource>
</transactionManager>
查看 this 以了解更多信息。