Spring框架中mysql資料庫連線池bean設定出錯
Spring
報錯資訊:(一般屬於bean屬性不同名或者沒有set屬性函式或者set屬性函式命名不規範,導致無法識別初始化bean的內容)
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentdao' defined in file [F:\JavaWeb\Spring\src\applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'dataSource' of bean class [com.dongruan.dao.StudentDao]: Bean property 'dataSource' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
例項
<bean id="studentdao" class="com.dongruan.dao.StudentDao">
<property name="dataSource" ref="dataSource"></property>
</bean>
/*set函式要規範才會被讀取*/
public void SetDataSource(DataSource dataSource){
this.jdbcTemplate=new JdbcTemplate(dataSource);
}
/*應該改函式名SetDataSource——>setDataSource,成功執行*
相關文章
- Python 中的 MySQL 資料庫連線池PythonMySql資料庫
- MySql資料庫連線池專題MySql資料庫
- mysql資料庫連線池配置教程MySql資料庫
- 【MySQL】自定義資料庫連線池和開源資料庫連線池的使用MySql資料庫
- 連線資料庫出錯???資料庫
- JDBC、JDBC框架、資料庫事務、資料庫連線池JDBC框架資料庫
- 設定如何遠端連線mysql資料庫MySql資料庫
- JDBC【資料庫連線池、DbUtils框架、分頁】JDBC資料庫框架
- 資料庫連線池資料庫
- golang連線MySQL時候的連線池設定GolangMySql
- Spring JPA資料庫連線MySQLSpring資料庫MySql
- 《四 資料庫連線池原始碼》手寫資料庫連線池資料庫原始碼
- 資料庫連線池-Druid資料庫連線池原始碼解析資料庫UI原始碼
- Tomcat 5.5 配置 MySQL 資料庫連線池TomcatMySql資料庫
- Spring Boot整合Druid資料庫連線池Spring BootUI資料庫
- 資料庫連線池原理資料庫
- Proxool資料庫連線池資料庫
- JAVA資料庫連線池Java資料庫
- Flask資料庫連線池Flask資料庫
- 請教關於資料庫連線池的設定問題?資料庫
- 如何正確設定資料庫連線池的大小?我的天,原來之前都設定錯了!資料庫
- 資料庫連線池到底應該設多大?資料庫
- PostgreSQL資料庫連線保持設定SQL資料庫
- 資料庫連線設定失敗!資料庫
- 如何設定多資料庫連線?!資料庫
- python資料庫連線池Python資料庫
- 手寫資料庫連線池資料庫
- 瞭解資料庫連線池資料庫
- 資料庫連線池的理解資料庫
- 資料庫連線池的使用資料庫
- 資料庫連線池淺析資料庫
- WASCE的資料庫連線池資料庫
- JNDI配置資料庫連線池資料庫
- PROXOOL資料庫連線池使用資料庫
- 關於資料庫連線池資料庫
- .net 資料庫連線池配置資料庫
- 連線mysql資料庫MySql資料庫
- 用Navicat連線資料庫-資料庫連線(MySQL演示)資料庫MySql