当前位置: 代码迷 >> Java Web开发 >> Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver'该怎么解决
  详细解决方案

Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver'该怎么解决

热度:794   发布时间:2016-04-14 21:10:48.0
Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver'
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:Oracle:thin:@192.168.0.112:1521:XXX'

<bean id="oracleDatasource" class="org.apache.commons.dbcp.BasicDataSource">
         <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
         <property name="url" value="jdbc:Oracle:thin:@192.168.0.112:1521:XXX" />
         <property name="username" value="XXXXXX" />
         <property name="password" value="XXXXXX" />
    </bean>

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="oracleDatasource" />
</property>

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle10gDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="mappingDirectoryLocations">
<list>
<value>
classpath*:com/zkdd/bean/
     </value>
</list>
</property>
</bean>

我使用ojdbc14.jar和ojdbc6,jar都报同样错误。
------解决思路----------------------
'jdbc:Oracle:thin:@192.168.0.112:1521:XXX'
oracle小写 
jdbc:oracle:thin:@192.168.0.112:1521:XXX 再试试看
  相关解决方案