Can you verify that in your log Spring has reported that the Driver has been loaded correctly ? https://github.com/spring-projects/spring-framework/blob/master/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DriverManagerDataSource.java#L133
On Mon, May 5, 2014 at 4:46 PM, Shiv <[email protected]> wrote: > conn maybe null if any of the parameters is invalid, right? > > If everything alright with below configuration for MS SQL Server? > <bean id="testdb" > class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> > <property name="driverClass" > value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> > <property name="url" > value="jdbc:microsoft:sqlserver://hostname:1433;DatabaseName=testdb"/> > <property name="username" value="test"/> > <property name="password" value="test"/> > </bean> > > Also, if I understand the flow correctly, JDBC Producer class calls conn = > dataSource.getConnection() which is handled by SimpleDriverDataSource > class's getConnectionFromDriver method given all parameters (driverClass, > url, username, password) are set. Here all the arguments defined in Spring > configuration file are String but SimpleDriverDataSource class has one > method setDriver(Driver) which is expecting java.sql.Driver. Though i doubt > it but if this conversion is not happening properly? - Just a wild guess. > > Also, since i am using camel core and camel jdbc 2.2.0 jars, if there is > any > fixed version of spring jdbc jar has to be used. Currently, i downloaded > 2.5.6 version of spring jdbc jar. Any compatibility issue? > > Thanks > Shiv > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/java-lang-NullPointerException-in-Camel-JDBC-component-for-Select-statement-tp5750783p5750872.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
