包装与Java中的类 [英] Packages & classes in Java

查看:49
本文介绍了包装与Java中的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

软件包util中的日期"类与sql软件包中的日期"类有什么区别?

What is the difference between class ''Date'' in package util & class ''Date'' in package sql?

推荐答案

软件包util中的Java日期格式.在sql包中将代表数据库的Date格式.这些格式通常不匹配,需要进行转换.您可以将其视为与文本编码有些相同,

祝你好运!
In package util is the Java Date Format. In the sql package will represent the database Date format. These formats often don''t match and need to be converted. You can look at it as somewhat the same as with encodings for text,

Good luck!


(啦啦迈克)他们将详细信息隐藏在文档中:
java.util.date [ java.sql.date [
(à la Led Mike) They hide the details in the documentation:
java.util.date[^].
java.sql.date[^].
:)


Jave Date的最小值小于SQL Date.请注意,因此,从Java Date强制转换为SQL Date并不总是有效.由于堆栈溢出,您可能会获得异常.
在.NET中也会发生这种情况.
Jave Date has a minimum value smaller than SQL Date. Be aware that casting from Java Date to SQL Date doesn''t always work because of this. You can get an exception due to stack over flow.
This also happens in .NET.


这篇关于包装与Java中的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆