Posts

Sample Cursor in Oracle Sql

Sample PL/SQL Programming SET SERVEROUTPUT ON; BEGIN    dbms_output.put_line  (user || ' Tables in the database:');    FOR t IN (SELECT table_name FROM user_tables)    LOOP       dbms_output.put_line(t.table_name);    END LOOP; END; Sample Cursor Example  DECLARE     CURSOR emp_cursor IS     SELECT         first_name     FROM         emp;     cur_first_name emp.first_name%TYPE; BEGIN     OPEN emp_cursor;     LOOP         FETCH emp_cursor INTO cur_first_name;         IF emp_cursor%notfound THEN             EXIT;         END IF;         dbms_output.put_line('Emp First Name :' || cur_first_name);     END LOOP;     dbms_output.put_line(' Total Count ' || emp_cursor%rowcount);     CLOSE emp_cursor; END;
Image
Internal Working of Java HashMap 1. Map and HashMap Map is a collection which stores elements as key-value pairs. A map cannot contain duplicate keys and each key can map to at most one value. The  Map  interface includes methods for basic operations (such as  put ,  get ,  remove ,  containsKey ,  containsValue ,  size , and  empty ), bulk operations (such as  putAll  and  clear ), and collection views (such as  keySet ,  entrySet , and  values ). HashMap  implements  Map  interface in java. It is not synchronized and is not thread safe. Here is an example how to use  HashMap  in java: 1 public   static   void   main(String[] args)  throws   IOException { 2 3          Map hashMap =  new   HashMap(); 4          hashMap.put( 11 , "Soccer" ); 5          hashMap.put( 22 , "Rugby" ); 6          hashMap.put( 33 , "Baseball" ); 7          System.out.println( "Map is "   + hashMap); 8 } Output: