groovy oracle date
There are lots of problems with Oracle DATE & TIMESTAMP and their
counterpart Java classes since they do not directly compare. DATE fields
in Oracle will give date & time where as TIMESTAMP gives you a bit more
information (down to millis I think). SQL92 says DATE is year, month &
day (which is why java.sql.Date only gives you this).
As Jon said you will be getting back an instance of java.sql.Date (the
metadata for this column will claim you'll be getting back a timestamp
but it lies; look up oracle.jdbc.V8Compatable for more information). The
only way to be 100% sure about what you're getting back is to ask for
the timestamp or change your Oracle fields from DATE to TIMESTAMP and
then you're more inline with how Java will deal with it.
Andy
P.S. If you do change the field data type you'll get back a
oracle.sql.TIMESTAMPZ object which is castable to a java.sql.Timestamp
Jon Carlson wrote:
> It
Ïà¹ØÎĵµ£º
×î½ü·¢ÏÖÒ»¸öÎÊÌ⣬һ¸ö9iÅÜÔÚredhat5µÄ£¬¾ÓÈ» select sysdate from dual ³öÀ´µÄʱ¼äºÍʵ¼Êʱ¼ä²îÁ˼¸·ÖÖÓ£¬ÒòΪ»ùÓÚÕâ¸öoracleµÄϵͳʱ¼äÕýÈ·ÐÔ»¹ÊÇÓеãÒªÇóµÄ¡£ËùÒÔÖ»ÄÜ #date -s 2010-2-10 8:55:00 ÁË£¬ÔÙ#clock -w дÈëCOMS ×¢ÒâÐÞ¸Äʱ¼äµÃÔÚrootÏ¡£
ÔÚϵͳÆô¶¯Ê±£¬Linux²Ù×÷ϵͳ½«Ê±¼ä´ÓCMOSÖжÁµ½ÏµÍ³Ê ......
select p.spid,
a.serial#,
c.object_name,
b.session_id,
b.oracle_username,
b.os_user_name
from v$proces ......
´Ó¸ÅÄʾÀý—Oracle´´½¨³ÌÐò°ü
Ò»¡¢³ÌÐò°üµÄÏà¹ØÖªÊ¶
1.¶¨ÒåÓë˵Ã÷
a. Ïà¹Ø¶ÔÏóµÄ·â×°
b. ³ÌÐò°üµÄ¸÷²¿·Ö
- ³ÌÐò°ü¹æ¸ñ˵Ã÷
ÉùÃ÷×Ó³ÌÐò
- ³ÌÐò°üÖ÷Ìå
......
±í¡¡¡¡¡¡¡¡tree
¡¡¡¡×ֶΡ¡¡¡¡¡master
¡¡¡¡¡¡¡¡¡¡¡¡¡¡sub
¡¡¡¡¡¡¡¡¡¡¡¡¡¡sales
¡¡¡¡insert into tree values
¡¡¡¡('Ö÷1',¡¡¡¡ 'Ö÷2',¡¡ 15);¡¡
¡¡¡¡insert into tree values¡¡¡¡¡¡
¡¡¡¡('Ö÷1',¡¡¡¡ 'Ö÷3',¡¡ 20);¡¡¡¡¡¡¡¡¡¡
¡¡¡¡insert into tree values
¡¡¡¡('Ö÷2',¡¡¡¡ 'Ö÷4',¡¡¡¡5);¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡ ......
1. Oracle°²×°Íê³ÉºóµÄÔʼ¿ÚÁ
¡¡internal/oracle
¡¡¡¡sys/change_on_install
¡¡¡¡system/manager
¡¡¡¡scott/tiger
¡¡¡¡sysman/oem_temp
2. ORACLE9IAS WEB CACHEµÄÔʼĬÈÏÓû§ºÍÃÜÂ룿
administrator/administrator
3. oracle 8.0.5ÈçºÎ½¨Á¢Êý¾Ý¿â£¿
ÓÃorainst¡£¼ÙÈçÓÐmotif½çÃæ£¬Äܹ»ÓÃorainst /m¡ ......