Skip to content

Commit

Permalink
CAMEL-19671: camel-sql: Oracle JDBC driver issue with getting metadat…
Browse files Browse the repository at this point in the history
…a. Thanks to Dmitrii Antonov for patch. (#10912)
  • Loading branch information
davsclaus committed Jul 30, 2023
1 parent 0d0a900 commit 7798978
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.camel.component.sql;

import java.sql.Connection;
import java.sql.ParameterMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
Expand Down Expand Up @@ -254,7 +255,8 @@ private void populateStatement(PreparedStatement ps, Exchange exchange, String s
if (parametersCount > 0) {
expected = parametersCount;
} else {
expected = ps.getParameterMetaData() != null ? ps.getParameterMetaData().getParameterCount() : 0;
ParameterMetaData meta = ps.getParameterMetaData();
expected = meta != null ? meta.getParameterCount() : 0;
}

// only populate if really needed
Expand Down

0 comments on commit 7798978

Please sign in to comment.