Java Code Examples for java.sql.ParameterMetaData#parameterNullable()

The following examples show how to use java.sql.ParameterMetaData#parameterNullable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ParameterMetaDataJdbc30Test.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
        * print the parameter isNullable value in human readable form
 *
 * @param nullabilityValue 
        */
// @return the nullability status of the given parameter
static String parameterIsNullableInStringForm(int nullabilityValue){
	if (nullabilityValue ==  ParameterMetaData.parameterNoNulls)
			  return("PARAMETER_NO_NULLS");
	else if (nullabilityValue ==  ParameterMetaData.parameterNullable)
			  return("PARAMETER_NULLABLE");
	else if (nullabilityValue ==  ParameterMetaData.parameterNullableUnknown)
			  return("PARAMETER_NULLABLE_UNKNOWN");
	else
			  return("ERROR: donot recognize this parameter isNullable() value");
 	}
 
Example 2
Source File: SnowflakeParameterMetadata.java    From snowflake-jdbc with Apache License 2.0 5 votes vote down vote up
@Override
public int isNullable(int param) throws SQLException
{
  MetaDataOfBinds paramInfo = statementMetaData.getMetaDataForBindParam(param);
  if (paramInfo.isNullable())
  {
    return ParameterMetaData.parameterNullable;
  }
  return ParameterMetaData.parameterNoNulls;
}
 
Example 3
Source File: MariaDbParameterMetaData.java    From mariadb-connector-j with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public int isNullable(final int param) throws SQLException {
  if (getParameterInformation(param).isNotNull()) {
    return ParameterMetaData.parameterNoNulls;
  } else {
    return ParameterMetaData.parameterNullable;
  }
}
 
Example 4
Source File: ParameterMetaDataJdbc30Test.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
        * print the parameter isNullable value in human readable form
 *
 * @param nullabilityValue 
        */
// @return the nullability status of the given parameter
static String parameterIsNullableInStringForm(int nullabilityValue){
	if (nullabilityValue ==  ParameterMetaData.parameterNoNulls)
			  return("PARAMETER_NO_NULLS");
	else if (nullabilityValue ==  ParameterMetaData.parameterNullable)
			  return("PARAMETER_NULLABLE");
	else if (nullabilityValue ==  ParameterMetaData.parameterNullableUnknown)
			  return("PARAMETER_NULLABLE_UNKNOWN");
	else
			  return("ERROR: donot recognize this parameter isNullable() value");
 	}
 
Example 5
Source File: SQLTools.java    From jsqsh with Apache License 2.0 5 votes vote down vote up
/***
 * Decodes a parameter nullability indicator into a readable string
 * @param isnull The nullability indicator
 * @return The string
 */
public static String getParameterNullability(int isnull) {
    switch (isnull) {
    case ParameterMetaData.parameterNoNulls: return "NOT NULL";
    case ParameterMetaData.parameterNullable: return "NULL";
    case ParameterMetaData.parameterNullableUnknown: return "UNKNOWN";
    default:
        return "UNRECOGNIZED";
    }
}
 
Example 6
Source File: ParameterMetaDataJdbc30Test.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
        * print the parameter isNullable value in human readable form
 *
 * @param nullabilityValue 
        */
// @return the nullability status of the given parameter
static String parameterIsNullableInStringForm(int nullabilityValue){
	if (nullabilityValue ==  ParameterMetaData.parameterNoNulls)
			  return("PARAMETER_NO_NULLS");
	else if (nullabilityValue ==  ParameterMetaData.parameterNullable)
			  return("PARAMETER_NULLABLE");
	else if (nullabilityValue ==  ParameterMetaData.parameterNullableUnknown)
			  return("PARAMETER_NULLABLE_UNKNOWN");
	else
			  return("ERROR: donot recognize this parameter isNullable() value");
 	}
 
Example 7
Source File: ParameterMetadataImpl.java    From salesforce-jdbc with MIT License 4 votes vote down vote up
@Override
public int isNullable(int param) throws SQLException {
    return ParameterMetaData.parameterNullable;
}
 
Example 8
Source File: ESParameterMetaData.java    From sql4es with Apache License 2.0 4 votes vote down vote up
@Override
public int isNullable(int param) throws SQLException {
	return ParameterMetaData.parameterNullable;
}
 
Example 9
Source File: FBParameterMetaData.java    From jaybird with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public int isNullable(int parameter) throws SQLException {
    return (getFieldDescriptor(parameter).getType() & 1) == 1
            ? ParameterMetaData.parameterNullable
            : ParameterMetaData.parameterNoNulls;
}