3

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>
Raja
  • 851
  • 9
  • 22
Nishant Prabhu
  • 85
  • 1
  • 2
  • 11
  • Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [org.netezza.Driver] – Nishant Prabhu Jul 21 '15 at 04:55
  • `system` scoped jars aren't packaged in your jar. See http://stackoverflow.com/questions/10935135/maven-and-adding-jars-to-system-scope – M. Deinum Jul 21 '15 at 05:51
  • Got your point but i copy it manually while packaging war using the resources tag – Nishant Prabhu Jul 21 '15 at 05:55
  • No you aren't... You are only specifying a path you aren't copying anything with that. You would need a modified config of the war-plugin for that. – M. Deinum Jul 21 '15 at 05:56
  • Where can i download the nzjdbc.jar ? – 2Big2BeSmall Jul 14 '16 at 11:54

1 Answers1

3

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

Ralph
  • 118,862
  • 56
  • 287
  • 383