简体   繁体   中英

Cannot load netezza JDBC driver

I have configured a netezza db in spring . I have added the dependent nzjdbc.jar in the classpath

Spring config:

<bean id="QA_CAM_BASE_jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">

    <!-- Initialization for data source -->

<bean id="QA_CAM_BASE_dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="${com.ec.database.driver}"/>
    <property name="url" value="${com.ec.database.url}"/>
    <property name="username" value="${com.ec.database.user}"/>
    <property name="password" value="${com.ec.database.pass}"/>

pom xml config 

<dependency>
    <groupId>org.netezza</groupId>
    <artifactId>netezza</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/resources/lib/nzjdbc.jar</systemPath>
</dependency>

<resource> 
    <directory>${basedir}/src/main/resources/lib</directory> 
    <targetPath>WEB-INF/lib</targetPath> 
</resource> 
</webResources>

Put the nzjdbc.jar in your local maven repository

mvn install:install-file -Dfile=netezza.jar -DgroupId=org.netezza -DartifactId=netezza -Dversion=1.0 -Dpackaging=jar

(execute this in the directory where the netezza.jar is located

And then use it like a normal dependency:

<dependency>
    <groupId>org.netezza</groupId>
    <artifactId>netezza</artifactId>
    <version>1.0</version>
</dependency>

@See Guide to installing 3rd party JARs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM