BeanPropertyRowMapper
requires the spring-jdbc
JAR to be present on the classpath. To do this, you would either need to compile your program and manually include the spring-jdbc
JAR on the classpath using command line flags. For more information, see Including jars in classpath on commandline (javac or apt). The spring-jdbc
JAR can be found at Maven Repository. The catch is that JAR may require many more dependencies, which can be a hassle to get right.
I would suggest turning your project into a Maven project. For more information on creating a Maven project, see Maven in 5 Minutes. Once you Mavenize your project, add the following to your pom.xml
, where ${spring.version}
is the version of Spring you decide to use:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
Then, in the file that uses BeanPropertyRowMapper
, add the following import statement:
import org.springframework.jdbc.core.BeanPropertyRowMapper;