ʹÓÃHibernate²åÈëoracle DateÀàÐ͵ÄÀý×Ó
package test;
import java.text.SimpleDateFormat;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.classic.Session;
import po.Stu;
public class Insert1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Configuration cf = new Configuration().configure();
SessionFactory sf = cf.buildSessionFactory();
Session session = sf.openSession();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String aa = "1999-12-22";
java.util.Date timeDate = null;
try {
timeDate = sdf.parse(aa);
} catch (Exception e) {
// TODO ×Ô¶¯Éú³É catch ¿é
e.printStackTrace();
}// utilÀàÐÍ
java.sql.Date dateTime = new java.sql.Date(timeDate.getTime());// sqlÀàÐÍ
Stu stu = new Stu("00000", "ÕÅÈý", "ÄÐ", dateTime, "ɽ¶«", "111");
Transaction t = session.beginTransaction();
try {
session.save(stu);
t.commit();
} catch (Exception e) {
e.printStackTrace();
} finally {
t.rollback();
session.close();
}
}
}
Ïà¹ØÎĵµ£º
µÚËÄÕ£ºË÷Òý
1.creating function-based indexes
sql> create index summit.item_quantity on summit.item(quantity-quantity_shipped);
2.create a B-tree index
sql> create [unique] index index_name on table_name(column,.. asc/desc) tablespace
sql> tablespace_name [pctfree integer] ......
OracleÖзÖÎö±íµÄ×÷ÓÃ
http://diegoball.javaeye.com/blog/568009
ÎÄÕ·ÖÀà:Êý¾Ý¿â
1.·ÖÎö¸üбíµÄͳ¼ÆÐÅÏ¢,,ÓпÉÄܵ¼ÖÂÖ´Ðмƻ®¸Ä±ä..
2.ÒÔµÄanalyze table abc compute statistics;ÕâÌõΪÀý£¬Éú³ÉµÄͳ¼ÆÐÅÏ¢»á´æÔÚÓÚuser_tablesÕâ¸öÊÓͼ£¬²é¿´Ò»ÏÂselect * from user_tables where table_name='ABC';
¹Û²ìÒ»ÏÂNUM_RO ......
1 ²é¿´oracleµÄ°æ±¾ÐÅÏ¢
£¨1£©Óÿͻ§¶ËÁ¬½Óµ½Êý¾Ý¿â£¬Ö´ÐÐselect * from v$instance
²é¿´versionÏî
£¨2£©select * from product_component_version
£¨3£©»ò²éѯV$VERSION²é¿´×é¼þ¼¶ÐÅÏ¢ ......
SQL:½á¹¹»¯²éѯÓïÑÔ
C R U D: Ôöɾ¸Ä²é
table : name age score
desc+±íÃû ---> ²éѯ±í½á¹¹
»òÕßÓà describe ÃüÁî (descÊÇdescribeµÄ¼òд)
²éѯÓïÑÔ£ºSELECT [DISTINCT] {*,column[alias],...} from table;
SELECT identifies what columns from identifies which tab ......
1£®Ê²Ã´½Ð×öÂãÉ豸£¿
¡¡¡¡ÂãÉ豸£¬Ò²½ÐÂã·ÖÇø£¨Ôʼ·ÖÇø£©£¬ÊÇÒ»ÖÖûÓо¹ý¸ñʽ»¯£¬²»±»Unixͨ¹ýÎļþϵͳÀ´¶ÁÈ¡µÄÌØÊâ×Ö·ûÉ豸¡£ËüÓÉÓ¦ÓóÌÐò¸ºÔð¶ÔËü½øÐжÁд²Ù×÷¡£²»¾¹ýÎļþϵͳµÄ»º³å¡£
2£®ÈçºÎ±æ±ðÂãÉ豸£¿
¡¡¡¡ÔÚUnixµÄ/dev Ŀ¼Ï£¬ÓÐÐí¶àÎļþ£¬ÆäÖÐÓÐÁ½¸ö´óÀࣺ×Ö·ûÉ豸ÎļþºÍ¿éÉ豸Îļþ¡£
¡¡¡¡×Ö·ûÉè±¸Ì ......