@Override public Object parseValue(int type, String value) { if (value != null) { Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } if (value.isEmpty()) value = null; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value != null) { Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } if (value.isEmpty()) value = null; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
@Override public Object parseValue(final int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
@Override public Object parseValue(final int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } Matcher valueMatcher = VALUE_PATTERN.matcher(value); while (valueMatcher.matches()) { value = valueMatcher.group(1); valueMatcher = VALUE_PATTERN.matcher(value); } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: case Types.NVARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.VARCHAR: case Types.TIMESTAMP: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; case Types.INTEGER: case Types.DOUBLE: case Types.BIGINT: case Types.BOOLEAN: //AO-3463: in case if column definition contains `DEFAULT value NOT NULL` Oracle returns value with an extra space in the end. //In such case we need to trim the value value = value.trim(); break; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.VARCHAR: case Types.TIMESTAMP: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; case Types.INTEGER: case Types.DOUBLE: case Types.BIGINT: case Types.BOOLEAN: //AO-3463: in case if column definition contains `DEFAULT value NOT NULL` Oracle returns value with an extra space in the end. //In such case we need to trim the value value = value.trim(); break; } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; case Types.BIT: try { return Byte.parseByte(value); } catch (Throwable t) { try { return Boolean.parseBoolean(value); } catch (Throwable t1) { return null; } } } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; case Types.BIT: try { return Byte.parseByte(value); } catch (Throwable t) { try { return Boolean.parseBoolean(value); } catch (Throwable t1) { return null; } } } return super.parseValue(type, value); }
@Override public Object parseValue(int type, String value) { if (value == null || value.equals("") || value.equals("NULL")) { return null; } Matcher valueMatcher = VALUE_PATTERN.matcher(value); while (valueMatcher.matches()) { value = valueMatcher.group(1); valueMatcher = VALUE_PATTERN.matcher(value); } switch (type) { case Types.TIMESTAMP: case Types.DATE: case Types.TIME: case Types.VARCHAR: case Types.NVARCHAR: Matcher matcher = Pattern.compile("'(.*)'.*").matcher(value); if (matcher.find()) { value = matcher.group(1); } break; } return super.parseValue(type, value); }
throw new IllegalStateException("Could not find column '" + columnName + "' in previously parsed query!"); current.setDefaultValue(databaseProvider.parseValue(current.getDatabaseType().getJdbcWriteType(), parseStringValue(rs, "COLUMN_DEF"))); current.setNotNull(current.isNotNull() || parseStringValue(rs, "IS_NULLABLE").equals("NO"));
throw new IllegalStateException("Could not find column '" + columnName + "' in previously parsed query!"); current.setDefaultValue(databaseProvider.parseValue(current.getDatabaseType().getJdbcWriteType(), parseStringValue(rs, "COLUMN_DEF"))); current.setNotNull(current.isNotNull() || parseStringValue(rs, "IS_NULLABLE").equals("NO"));