Archive for the 'มุม DB' Category

toad not connect to windows 7 64 bit

Saturday, March 19th, 2011

ปัญหาคือลง Windows 7 Pro 64 bit แล้วไม่สามารถใช้ toad connect Oracle ได้ ทั้งที่ลองเทสผ่าน PL/SQL ผ่าน Problem: 1 2 3 4 5 6 Cause: 64-bit Microsoft OS’s install 32-bit applications into the following location "C:\Program Files (x86)\…" rather than the typical location of   "C:\Program Files\…" This causes an existing networking bug to occur where the networking […]

Oracle DATE Format

Friday, April 23rd, 2010

ดูเวลาใน Oracle select sysdate from dual; TO_CHAR : 1 TO_CHAR(<date>, ‘<format>’)TO_CHAR(<date>, ‘<format>’) To_DATE : 1 TO_DATE(<string>, ‘<format>’)TO_DATE(<string>, ‘<format>’) DATE Format 1 2 3 4 5 6 7 8 9 10 11 12 13 MM : Numeric month (e.g., 07) MON : Abbreviated month name (e.g., JUL) MONTH : Full month name (e.g., JULY) DD : […]

Hibernate ประยุกต์ทำPagingของ MS SQL Server

Sunday, February 7th, 2010

เอาไว้ทำ Paging หรือ คิวรีแบบจำกัดจำนวนก็ได้ครับ สะดวกดีด้วย Hibernate – Tuning Queries Using Paging, Batch Size, and Fetch Joins 1 2 3 4 5 6 7 8 9 10 11 … String hql = "From Customer"; Query q = session.createQuery(hql); q.setFirstResult(pageNum*100).setMaxResults(100); long a = System.currentTimeMillis(); List l = q.getResultList(); for (Customer c : l) { c.getOrders().size(); } System.out.println("Execution […]