Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import org.springframework.jdbc.core with maven

I dont know why the follow imports are not getting found in my project: Code:

import org.springframework.jdbc.core.SqlInOutParameter;
import org.springframework.jdbc.core.SqlParameter;
import org.springframework.jdbc.object.StoredProcedure;

I have the folllowing in my pom.xml file

Code:

<dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-context</artifactId>
 <version>3.2.1.RELEASE</version>
</dependency>

But I have found that if I add the following it works but I dont see why I need to:

<dependency>
      <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${springframework-version}</version>
</dependency>
like image 901
SJS Avatar asked Feb 22 '13 16:02

SJS


Video Answer


2 Answers

If you want to work with Spring Jdbc packages you have to import the correct library:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>3.2.1.RELEASE</version>
</dependency>
like image 74
Gerard Ribas Avatar answered Oct 11 '22 19:10

Gerard Ribas


SqlInOutParameter, SqlParameter and StoredProcedure require the spring-jdbc artifact.

It does not appear in the dependent artifacts for spring-context. The artifact for spring-orm does contain this dependency however. See here

like image 29
Reimeus Avatar answered Oct 11 '22 19:10

Reimeus