cs.registerOutParameter(2,Types.DECIMAL);
//parameter 4 is output only
cs.registerOutParameter(3,Types.DECIMAL);
//verify the meta data for the parameters
ParameterMetaData paramMetaData = cs.getParameterMetaData();
assertEquals("Unexpected parameter count", 3, paramMetaData.getParameterCount());
//expected values to be stored in a 2dim. array
String parameterMetaDataArray0 [][] = {
//isNullable, isSigned, getPrecision, getScale, getParameterType, getParameterTypeName, getParameterClassName, getParameterMode
{"PARAMETER_NULLABLE", "true", "4", "2", "3", "DECIMAL", "java.math.BigDecimal", "PARAMETER_MODE_IN"},
{"PARAMETER_NULLABLE", "true", "9", "0", "3", "DECIMAL", "java.math.BigDecimal", "PARAMETER_MODE_IN_OUT"},
{"PARAMETER_NULLABLE", "true", "10", "2", "3", "DECIMAL", "java.math.BigDecimal", "PARAMETER_MODE_OUT"}};
testParameterMetaData(cs.getParameterMetaData(), parameterMetaDataArray0);
cs.close();
cs = prepareCall("CALL PMDD(32.4, 47.9, ?, ?)");
// parameter 3 is input and output
Object y = new BigDecimal(1.1);
cs.setObject(1,y, Types.DECIMAL);
cs.registerOutParameter(1,Types.DECIMAL);
//parameter 4 is output only
cs.registerOutParameter(2,Types.DECIMAL);
paramMetaData = cs.getParameterMetaData();
assertEquals("Unexpected parameter count", 2, paramMetaData.getParameterCount());
//expected values to be stored in a 2dim. array
String parameterMetaDataArray1 [][] = {
//isNullable, isSigned, getPrecision, getScale, getParameterType, getParameterTypeName, getParameterClassName, getParameterMode
{"PARAMETER_NULLABLE", "true", "9", "0", "3", "DECIMAL", "java.math.BigDecimal", "PARAMETER_MODE_IN_OUT"},
{"PARAMETER_NULLABLE", "true", "10", "2", "3", "DECIMAL", "java.math.BigDecimal", "PARAMETER_MODE_OUT"}};
testParameterMetaData(cs.getParameterMetaData(), parameterMetaDataArray1);
cs.close();
cs = prepareCall("CALL PMDD(?, 38.2, ?, ?)");
// parameters 1 is input only
cs.setBigDecimal(1,new BigDecimal("1"));;
// parameter 3 is input and output
Object z = new BigDecimal(1.1);
cs.setObject(2,z, Types.DECIMAL);
cs.registerOutParameter(2,Types.DECIMAL);
//parameter 4 is output only
cs.registerOutParameter(3,Types.DECIMAL);
//verify the meta data for the parameters
paramMetaData = cs.getParameterMetaData();
assertEquals("Unexpected parameter count", 3, paramMetaData.getParameterCount());
//expected values to be stored in a 2dim. array
String parameterMetaDataArray2 [][] = {
//isNullable, isSigned, getPrecision, getScale, getParameterType, getParameterTypeName, getParameterClassName, getParameterMode
{"PARAMETER_NULLABLE", "true", "5", "3", "3", "DECIMAL", "java.math.BigDecimal", "PARAMETER_MODE_IN"},