---
title: "Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]"
author: "书安然"
date: "2014-11-12T14:47:38Z"
tags: ["Spring"]
categories: ["企业架构"]
slug: "could-not-load-jdbc-driver-class-oracle-jdbc-driver-oracledriver"
draft: false
lastmod: "2014-11-12T14:47:38Z"
id: 2154960
url: "https://amflytogether.iteye.com/blog/2154960"
---

在用spring框架连接JDBC数据库时
发生如下错误：
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dataSource' defined in class path resource : 
Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException;
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: 
org.springframework.beans.MethodInvocationException: 
Property 'driverClassName' threw exception; nested exception 
is java.lang.IllegalStateException: <span style="color:red">Could not load JDBC driver class </span>

错误原因：
未导入数据库ojdbc6.jar包或ojdbc14.jar包