Java Code Examples for java.sql.Types#REF_CURSOR

The following examples show how to use java.sql.Types#REF_CURSOR . 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: ProcedureParameterImpl.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void setHibernateType(Type expectedType) {
	super.setHibernateType( expectedType );

	if ( mode == ParameterMode.REF_CURSOR ) {
		sqlTypes = new int[] { Types.REF_CURSOR };
	}
	else {
		if ( expectedType == null ) {
			throw new IllegalArgumentException( "Type cannot be null" );
		}
		else {
			sqlTypes = expectedType.sqlTypes( procedureCall.getSession().getFactory() );
		}
	}

}
 
Example 2
Source File: StandardRefCursorSupport.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private int refCursorTypeCode() {
	return Types.REF_CURSOR;
}
 
Example 3
Source File: JDBC42Helper.java    From r-course with MIT License 4 votes vote down vote up
static boolean isSqlTypeSupported(int sqlType) {
    return sqlType != Types.REF_CURSOR && sqlType != Types.TIME_WITH_TIMEZONE && sqlType != Types.TIMESTAMP_WITH_TIMEZONE;
}
 
Example 4
Source File: JDBC42Helper.java    From Komondor with GNU General Public License v3.0 4 votes vote down vote up
static boolean isSqlTypeSupported(int sqlType) {
    return sqlType != Types.REF_CURSOR && sqlType != Types.TIME_WITH_TIMEZONE && sqlType != Types.TIMESTAMP_WITH_TIMEZONE;
}
 
Example 5
Source File: ParseUtil.java    From datacollector with Apache License 2.0 4 votes vote down vote up
public static Field generateField(
    String column,
    String columnValue,
    int columnType,
    DateTimeColumnHandler dateTimeColumnHandler
) throws StageException {
  Field field;
  // All types as of JDBC 2.0 are here:
  // https://docs.oracle.com/javase/8/docs/api/constant-values.html#java.sql.Types.ARRAY
  // Good source of recommended mappings is here:
  // http://www.cs.mun.ca/java-api-1.5/guide/jdbc/getstart/mapping.html
  switch (columnType) {
    case Types.BIGINT:
      field = Field.create(Field.Type.LONG, columnValue);
      break;
    case Types.BINARY:
    case Types.LONGVARBINARY:
    case Types.VARBINARY:
      field = Field.create(Field.Type.BYTE_ARRAY, RawTypeHandler.parseRaw(column, columnValue, columnType));
      break;
    case Types.BIT:
    case Types.BOOLEAN:
      field = Field.create(Field.Type.BOOLEAN, columnValue);
      break;
    case Types.CHAR:
    case Types.LONGNVARCHAR:
    case Types.LONGVARCHAR:
    case Types.NCHAR:
    case Types.NVARCHAR:
    case Types.VARCHAR:
      field = Field.create(Field.Type.STRING, columnValue);
      break;
    case Types.DECIMAL:
    case Types.NUMERIC:
      field = Field.create(Field.Type.DECIMAL, columnValue);
      break;
    case Types.DOUBLE:
      field = Field.create(Field.Type.DOUBLE, columnValue);
      break;
    case Types.FLOAT:
    case Types.REAL:
      field = Field.create(Field.Type.FLOAT, columnValue);
      break;
    case Types.INTEGER:
      field = Field.create(Field.Type.INTEGER, columnValue);
      break;
    case Types.SMALLINT:
    case Types.TINYINT:
      field = Field.create(Field.Type.SHORT, columnValue);
      break;
    case Types.DATE:
    case Types.TIME:
    case Types.TIMESTAMP:
      field = dateTimeColumnHandler.getDateTimeStampField(column, columnValue, columnType);
      break;
    case Types.TIMESTAMP_WITH_TIMEZONE:
    case TIMESTAMP_TZ_TYPE:
      field = dateTimeColumnHandler.getTimestampWithTimezoneField(columnValue);
      break;
    case TIMESTAMP_LTZ_TYPE:
      field = dateTimeColumnHandler.getTimestampWithLocalTimezone(columnValue);
      break;
    case Types.ROWID:
    case Types.CLOB:
    case Types.NCLOB:
    case Types.BLOB:
    case Types.ARRAY:
    case Types.DATALINK:
    case Types.DISTINCT:
    case Types.JAVA_OBJECT:
    case Types.NULL:
    case Types.OTHER:
    case Types.REF:
    case Types.REF_CURSOR:
    case Types.SQLXML:
    case Types.STRUCT:
    case Types.TIME_WITH_TIMEZONE:
    default:
      throw new UnsupportedFieldTypeException(column, columnValue, columnType);
  }
  return field;
}