Cannot load netezza JDBC driver

2020-04-11 03:51发布

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>

1条回答
乱世女痞
2楼-- · 2020-04-11 04:06

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

查看更多
登录 后发表回答