diff --git a/src/main/java/org/mariadb/jdbc/MariaDbParameterMetaData.java b/src/main/java/org/mariadb/jdbc/MariaDbParameterMetaData.java index 94b35d4..8b687c4 100644 --- a/src/main/java/org/mariadb/jdbc/MariaDbParameterMetaData.java +++ b/src/main/java/org/mariadb/jdbc/MariaDbParameterMetaData.java @@ -62,14 +62,16 @@ */ public class MariaDbParameterMetaData implements ParameterMetaData { private final ColumnInformation[] columnInformations; + private final ColumnInformation[] parametersIformations; - public MariaDbParameterMetaData(ColumnInformation[] columnInformations) { + public MariaDbParameterMetaData(ColumnInformation[] columnInformations, ColumnInformation[] parametersIformations) { this.columnInformations = columnInformations; + this.parametersIformations = parametersIformations; } @Override public int getParameterCount() throws SQLException { - return columnInformations.length; + return parametersIformations.length; } private ColumnInformation getColumnInformation(int column) throws SQLException { diff --git a/src/main/java/org/mariadb/jdbc/MariaDbServerPreparedStatement.java b/src/main/java/org/mariadb/jdbc/MariaDbServerPreparedStatement.java index aeea65f..7d18174 100644 --- a/src/main/java/org/mariadb/jdbc/MariaDbServerPreparedStatement.java +++ b/src/main/java/org/mariadb/jdbc/MariaDbServerPreparedStatement.java @@ -107,7 +107,7 @@ returnTableAlias = protocol.getOptions().useOldAliasMetadataBehavior; metadata = new MariaDbResultSetMetaData(prepareResult.columns, protocol.getDataTypeMappingFlags(), returnTableAlias); - parameterMetaData = new MariaDbParameterMetaData(prepareResult.columns); + parameterMetaData = new MariaDbParameterMetaData(prepareResult.columns, prepareResult.parameters); } catch (QueryException e) { try { this.close();