Skip to content

jdbc-demo的db配置有问题 #1

@honestAnt

Description

@honestAnt

问题:jdbc版本的demo代码配置有问题;
问题描述:
1.applicationContext_db_mysql.xml中的lcnDataSourceProxy对象中并没有对应的dataSource成员变量,强制赋值,容器启动会提示(org.springframework.beans.NotWritablePropertyException: Invalid property 'dataSource' of bean class [com.codingapi.tx.datasource.relational.LCNTransactionDataSource]: 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?)
2.jdbcTemplate的dataSource成员变量赋值类型有问题,启动提示(java.lang.IllegalStateException: Cannot convert value of type 'com.codingapi.tx.datasource.relational.LCNTransactionDataSource' to required type 'javax.sql.DataSource' for property 'dataSource': no matching editors or conversion strategy found)

开发工具:intellij idea
开发环境:windows7
jdk版本:1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions