Skip to content

Autowired issue #30

@fsanna13

Description

@fsanna13

Using IntelliJ, the Autowired annotation for the jdbcTemplate variable is labeled as an issue.

...
public static void main(String[] args) {
	SpringApplication.run(SpringjdbcApplication.class, args);
}

@Autowired //Field injection is not recommended
JdbcTemplate jdbcTemplate;

@Override
public void run(String... args) throws Exception {
        log.info("Creating tables");
...

It says that "Field injection is not recommended". How to solve this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions