日期:2014-05-19  浏览次数:20724 次

java连接oracles数据库报错,求解
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
destroy-method="close"
p:driverClass="oralce.jdbc.dirver.OracleDriver"
p:jdbcUrl="jdbc:oracle:thin:@localhost:1521:orcl"
p:user="system"
p:password="tiger"/>


严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'driverClass' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'driverClass' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'driverClass' of bean class [org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property 'driverClass' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

------最佳解决方案--------------------
最后一个是报找不到这个驱动,那么是不是没有引入必要开发包?
------其他解决方案--------------------
这样配连接池起不了作用的,用dbcp或c3p0好点

------其他解决方案--------------------
p:driverClass="oralce.jdbc.dirver.OracleDriver"
连接参数名在属性文件中是不是一一对应呢?
------其他解决方案--------------------
不是driverClassName吗?.....还有userName?我很凌乱
------其他解决方案--------------------
看这句:Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'driverClass' of bean class 
------其他解决方案--------------------
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.b