本文整理了Java中org.h2.value.Value.getDate()
方法的一些代码示例,展示了Value.getDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Value.getDate()
方法的具体详情如下:
包路径:org.h2.value.Value
类名称:Value
方法名:getDate
暂无
代码示例来源:origin: com.h2database/h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnLabel the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public Date getDate(String columnLabel) throws SQLException {
try {
debugCodeCall("getDate", columnLabel);
return get(columnLabel).getDate();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public Date getDate(int columnIndex) throws SQLException {
try {
debugCodeCall("getDate", columnIndex);
return get(columnIndex).getDate();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/h2
return type.cast(value.getDouble());
} else if (type == Date.class) {
return type.cast(value.getDate());
} else if (type == Time.class) {
return type.cast(value.getTime());
代码示例来源:origin: org.wowtools/h2
/**
* Converts a value to a LocalDate.
*
* <p>This method should only called from Java 8 or later.</p>
*
* @param value the value to convert
* @return the LocalDate
*/
public static Object valueToLocalDate(Value value) {
return dateToLocalDate(value.getDate());
}
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnName the name of the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is closed
*/
public Date getDate(String columnName) throws SQLException {
try {
debugCodeCall("getDate", columnName);
return get(columnName).getDate();
} catch (Throwable e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is closed
*/
public Date getDate(int columnIndex) throws SQLException {
try {
debugCodeCall("getDate", columnIndex);
return get(columnIndex).getDate();
} catch (Throwable e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.eventsourcing/h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnLabel the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public Date getDate(String columnLabel) throws SQLException {
try {
debugCodeCall("getDate", columnLabel);
return get(columnLabel).getDate();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: org.wowtools/h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public Date getDate(int columnIndex) throws SQLException {
try {
debugCodeCall("getDate", columnIndex);
return get(columnIndex).getDate();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: org.wowtools/h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnLabel the column label
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public Date getDate(String columnLabel) throws SQLException {
try {
debugCodeCall("getDate", columnLabel);
return get(columnLabel).getDate();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.eventsourcing/h2
/**
* Returns the value of the specified column as a java.sql.Date.
*
* @param columnIndex (1,2,...)
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
@Override
public Date getDate(int columnIndex) throws SQLException {
try {
debugCodeCall("getDate", columnIndex);
return get(columnIndex).getDate();
} catch (Exception e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: org.wowtools/h2
return type.cast(value.getDouble());
} else if (type == Date.class) {
return type.cast(value.getDate());
} else if (type == Time.class) {
return type.cast(value.getTime());
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a java.sql.Date using a
* specified time zone.
*
* @param columnIndex (1,2,...)
* @param calendar the calendar
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
public Date getDate(int columnIndex, Calendar calendar) throws SQLException {
try {
if (debug()) {
debugCode("getDate(" + columnIndex + ", calendar)");
}
Date x = get(columnIndex).getDate();
return DateTimeUtils.convertDateToCalendar(x, calendar);
} catch (Throwable e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.h2database/com.springsource.org.h2
/**
* Returns the value of the specified column as a java.sql.Date using a
* specified time zone.
*
* @param columnName the name of the column label
* @param calendar the calendar
* @return the value
* @throws SQLException if the column is not found or if the result set is
* closed
*/
public Date getDate(String columnName, Calendar calendar) throws SQLException {
try {
if (debug()) {
debugCode("getDate(" + StringUtils.quoteJavaString(columnName) + ", calendar)");
}
Date x = get(columnName).getDate();
return DateTimeUtils.convertDateToCalendar(x, calendar);
} catch (Throwable e) {
throw logAndConvert(e);
}
}
代码示例来源:origin: com.eventsourcing/h2
return 1 + getVarLongLen(dateValue);
long x = DateTimeUtils.getTimeLocalWithoutDst(v.getDate());
return 1 + getVarLongLen(x / MILLIS_PER_MINUTE);
代码示例来源:origin: org.wowtools/h2
return 1 + getVarLongLen(dateValue);
long x = DateTimeUtils.getTimeLocalWithoutDst(v.getDate());
return 1 + getVarLongLen(x / MILLIS_PER_MINUTE);
代码示例来源:origin: org.wowtools/h2
SimpleDateFormat dayName = new SimpleDateFormat(
"EEEE", Locale.ENGLISH);
result = ValueString.get(dayName.format(v0.getDate()),
database.getMode().treatEmptyStringsAsNull);
break;
result = ValueInt.get(DateTimeUtils.getDatePart(v0.getDate(),
Calendar.DAY_OF_MONTH));
break;
case DAY_OF_WEEK:
result = ValueInt.get(DateTimeUtils.getDatePart(v0.getDate(),
Calendar.DAY_OF_WEEK));
break;
case DAY_OF_YEAR:
result = ValueInt.get(DateTimeUtils.getDatePart(v0.getDate(),
Calendar.DAY_OF_YEAR));
break;
break;
case MONTH:
result = ValueInt.get(DateTimeUtils.getDatePart(v0.getDate(),
Calendar.MONTH));
break;
SimpleDateFormat monthName = new SimpleDateFormat("MMMM",
Locale.ENGLISH);
result = ValueString.get(monthName.format(v0.getDate()),
database.getMode().treatEmptyStringsAsNull);
break;
代码示例来源:origin: org.wowtools/h2
writeLong(((ValueDate) v).getDateValue());
} else if (version >= Constants.TCP_PROTOCOL_VERSION_7) {
writeLong(DateTimeUtils.getTimeLocalWithoutDst(v.getDate()));
} else {
writeLong(v.getDate().getTime());
代码示例来源:origin: com.eventsourcing/h2
writeLong(((ValueDate) v).getDateValue());
} else if (version >= Constants.TCP_PROTOCOL_VERSION_7) {
writeLong(DateTimeUtils.getTimeLocalWithoutDst(v.getDate()));
} else {
writeLong(v.getDate().getTime());
代码示例来源:origin: org.wowtools/h2
} else {
writeByte((byte) type);
long x = DateTimeUtils.getTimeLocalWithoutDst(v.getDate());
writeVarLong(x / MILLIS_PER_MINUTE);
代码示例来源:origin: com.eventsourcing/h2
} else {
writeByte((byte) type);
long x = DateTimeUtils.getTimeLocalWithoutDst(v.getDate());
writeVarLong(x / MILLIS_PER_MINUTE);
内容来源于网络,如有侵权,请联系作者删除!