本文整理了Java中java.sql.Date.toInstant()
方法的一些代码示例,展示了Date.toInstant()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Date.toInstant()
方法的具体详情如下:
包路径:java.sql.Date
类名称:Date
方法名:toInstant
暂无
代码示例来源:origin: shalousun/ApplicationPower
/**
* Formats a java.sql.Date using a format string
*
* @param date java.sql.Date
* @param format format like yyyy-MM-dd
* @return String
*/
public static String sqlDateToStr(java.sql.Date date, String format) {
return format(LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()), format);
}
代码示例来源:origin: MarquezProject/marquez
@Override
public DbTableVersionRow map(@NonNull ResultSet results, @NonNull StatementContext context)
throws SQLException {
return DbTableVersionRow.builder()
.uuid(UUID.fromString(results.getString("uuid")))
.createdAt(results.getDate("created_at").toInstant())
.datasetUuid(UUID.fromString(results.getString("dataset_uuid")))
.dbTableInfoUuid(UUID.fromString(results.getString("db_table_info_uuid")))
.dbTable(results.getString("db_table"))
.build();
}
}
代码示例来源:origin: MarquezProject/marquez
@Override
public DbTableInfoRow map(@NonNull ResultSet results, @NonNull StatementContext context)
throws SQLException {
return DbTableInfoRow.builder()
.uuid(UUID.fromString(results.getString("uuid")))
.createdAt(results.getDate("created_at").toInstant())
.db(results.getString("db"))
.dbSchema(results.getString("db_schema"))
.build();
}
}
代码示例来源:origin: MarquezProject/marquez
@Override
public DataSourceRow map(@NonNull ResultSet results, @NonNull StatementContext context)
throws SQLException {
return DataSourceRow.builder()
.uuid(UUID.fromString(results.getString("uuid")))
.createdAt(results.getDate("created_at").toInstant())
.dataSource(results.getString("data_source"))
.connectionUrl(results.getString("connection_url"))
.build();
}
}
代码示例来源:origin: MarquezProject/marquez
@Override
public DatasetRow map(@NonNull ResultSet results, @NonNull StatementContext context)
throws SQLException {
return DatasetRow.builder()
.uuid(UUID.fromString(results.getString("uuid")))
.createdAt(results.getDate("created_at").toInstant())
.updatedAt(results.getDate("updated_at").toInstant())
.namespaceUuid(UUID.fromString(results.getString("namespace_uuid")))
.dataSourceUuid(UUID.fromString(results.getString("data_source_uuid")))
.urn(results.getString("urn"))
.description(results.getString("description"))
.currentVersion(UUID.fromString(results.getString("current_version")))
.build();
}
}
内容来源于网络,如有侵权,请联系作者删除!