JDBCResultSet.java (hsqldb-2.6.0) | : | JDBCResultSet.java (hsqldb-2.6.1) | ||
---|---|---|---|---|
skipping to change at line 100 | skipping to change at line 100 | |||
import java.time.Duration; | import java.time.Duration; | |||
import java.time.LocalDate; | import java.time.LocalDate; | |||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | |||
import java.time.LocalTime; | import java.time.LocalTime; | |||
import java.time.OffsetDateTime; | import java.time.OffsetDateTime; | |||
import java.time.OffsetTime; | import java.time.OffsetTime; | |||
import java.time.Period; | import java.time.Period; | |||
import java.time.ZoneOffset; | import java.time.ZoneOffset; | |||
//#endif JAVA8 | //#endif JAVA8 | |||
/* $Id: JDBCResultSet.java 6271 2021-01-29 14:39:07Z fredt $ */ | /* $Id: JDBCResultSet.java 6349 2021-06-10 10:54:35Z fredt $ */ | |||
//campbell-burnet@users 20051207 - patch 1.9.0 - initial JDBC 4.0 support work | //campbell-burnet@users 20051207 - patch 1.9.0 - initial JDBC 4.0 support work | |||
//fredt@users 20060431 - patch 1.9.0 rewrite with RowSetNavigator | //fredt@users 20060431 - patch 1.9.0 rewrite with RowSetNavigator | |||
//campbell-burnet@users 20060522 - doc 1.9.0 - full synch up to Mustang Build 84 | //campbell-burnet@users 20060522 - doc 1.9.0 - full synch up to Mustang Build 84 | |||
// Revision 1.21 2006/07/12 12:27:25 boucherb | // Revision 1.21 2006/07/12 12:27:25 boucherb | |||
// patch 1.9.0 | // patch 1.9.0 | |||
// - full synch up to Mustang b90 | // - full synch up to Mustang b90 | |||
/** | /** | |||
* <!-- start generic documentation --> | * <!-- start generic documentation --> | |||
skipping to change at line 6867 | skipping to change at line 6867 | |||
if (type == null) { | if (type == null) { | |||
throw JDBCUtil.nullArgument(); | throw JDBCUtil.nullArgument(); | |||
} | } | |||
Type hsqlType = Types.getParameterSQLType(type); | Type hsqlType = Types.getParameterSQLType(type); | |||
if(hsqlType == null) { | if(hsqlType == null) { | |||
throw JDBCUtil.sqlException(ErrorCode.X_42561); | throw JDBCUtil.sqlException(ErrorCode.X_42561); | |||
} | } | |||
Object source = getColumnValue(columnIndex); | ||||
if (wasNullValue) { | if (wasNullValue) { | |||
return null; | return null; | |||
} | } | |||
Object o = null; | Object o = null; | |||
switch(type.getName()){ | switch(type.getName()){ | |||
case "int": | case "int": | |||
case "java.lang.Integer": | case "java.lang.Integer": | |||
o = getInt(columnIndex); | o = getInt(columnIndex); | |||
skipping to change at line 6932 | skipping to change at line 6934 | |||
} | } | |||
case "java.sql.Time": { | case "java.sql.Time": { | |||
o = getTime(columnIndex); | o = getTime(columnIndex); | |||
break; | break; | |||
} | } | |||
case "java.sql.Timestamp": { | case "java.sql.Timestamp": { | |||
o = getTimestamp(columnIndex); | o = getTimestamp(columnIndex); | |||
break; | break; | |||
} | } | |||
case "java.util.UUID": { | case "java.util.UUID": { | |||
Object source = getColumnInType(columnIndex, hsqlType); | source = getColumnInType(columnIndex, hsqlType); | |||
o = Type.SQL_GUID.convertSQLToJava(session, source); | o = Type.SQL_GUID.convertSQLToJava(session, source); | |||
break; | break; | |||
} | } | |||
case "java.time.LocalDate": { | case "java.time.LocalDate": { | |||
Object source = getColumnInType(columnIndex, hsqlType); | source = getColumnInType(columnIndex, hsqlType); | |||
TimestampData v = (TimestampData) source; | TimestampData v = (TimestampData) source; | |||
long millis = v.getMillis(); | long millis = v.getMillis(); | |||
Calendar cal = session.getCalendarGMT(); | Calendar cal = session.getCalendarGMT(); | |||
cal.setTimeInMillis(millis); | cal.setTimeInMillis(millis); | |||
o = LocalDate.of(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH)); | o = LocalDate.of(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH)); | |||
break; | break; | |||
} | } | |||
case "java.time.LocalTime": { | case "java.time.LocalTime": { | |||
Object source = getColumnInType(columnIndex, hsqlType); | source = getColumnInType(columnIndex, hsqlType); | |||
TimeData v = (TimeData) source; | TimeData v = (TimeData) source; | |||
o = LocalTime.ofNanoOfDay(v.getSeconds() * 1000000000L + v.getNa nos()); | o = LocalTime.ofNanoOfDay(v.getSeconds() * 1000000000L + v.getNa nos()); | |||
break; | break; | |||
} | } | |||
case "java.time.LocalDateTime": { | case "java.time.LocalDateTime": { | |||
Object source = getColumnInType(columnIndex, hsqlType); | source = getColumnInType(columnIndex, hsqlType); | |||
TimestampData v = (TimestampData) source; | TimestampData v = (TimestampData) source; | |||
long millis = v.getMillis(); | long millis = v.getMillis(); | |||
int nanos = v.getNanos(); | int nanos = v.getNanos(); | |||
Calendar cal = session.getCalendarGMT(); | Calendar cal = session.getCalendarGMT(); | |||
cal.setTimeInMillis(millis); | cal.setTimeInMillis(millis); | |||
o = LocalDateTime.of(cal.get(Calendar.YEAR), cal.get(Calendar.MO NTH) + 1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get (Calendar.MINUTE), cal.get(Calendar.SECOND ), nanos); | o = LocalDateTime.of(cal.get(Calendar.YEAR), cal.get(Calendar.MO NTH) + 1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get (Calendar.MINUTE), cal.get(Calendar.SECOND ), nanos); | |||
break; | break; | |||
} | } | |||
case "java.time.OffsetTime": { | case "java.time.OffsetTime": { | |||
skipping to change at line 6976 | skipping to change at line 6978 | |||
case "java.time.OffsetDateTime": { | case "java.time.OffsetDateTime": { | |||
o = getTimestampWithZone(columnIndex); | o = getTimestampWithZone(columnIndex); | |||
break; | break; | |||
} | } | |||
case "java.time.Duration": { | case "java.time.Duration": { | |||
Type sourceType = resultMetaData.columnTypes[columnIndex - 1]; | Type sourceType = resultMetaData.columnTypes[columnIndex - 1]; | |||
if (!sourceType.isIntervalDaySecondType()) { | if (!sourceType.isIntervalDaySecondType()) { | |||
break; | break; | |||
} | } | |||
Object source = getColumnValue(columnIndex); | ||||
IntervalSecondData v = (IntervalSecondData) source; | IntervalSecondData v = (IntervalSecondData) source; | |||
o = Duration.ofSeconds(v.getSeconds(), v.getNanos()); | o = Duration.ofSeconds(v.getSeconds(), v.getNanos()); | |||
break; | break; | |||
} | } | |||
case "java.time.Period": { | case "java.time.Period": { | |||
Type sourceType = resultMetaData.columnTypes[columnIndex - 1]; | Type sourceType = resultMetaData.columnTypes[columnIndex - 1]; | |||
if (!sourceType.isIntervalYearMonthType()) { | if (!sourceType.isIntervalYearMonthType()) { | |||
break; | break; | |||
} | } | |||
Object source = getColumnValue(columnIndex); | ||||
IntervalMonthData v = (IntervalMonthData) source; | IntervalMonthData v = (IntervalMonthData) source; | |||
int months = v.getMonths(); | int months = v.getMonths(); | |||
if (sourceType.typeCode == Types.SQL_INTERVAL_MONTH) { | if (sourceType.typeCode == Types.SQL_INTERVAL_MONTH) { | |||
o = Period.ofMonths(months); | o = Period.ofMonths(months); | |||
} else { | } else { | |||
o = Period.of(months / 12, months % 12, 0); | o = Period.of(months / 12, months % 12, 0); | |||
} | } | |||
break; | break; | |||
} | } | |||
End of changes. 8 change blocks. | ||||
7 lines changed or deleted | 7 lines changed or added |