博文

RowSet & Oracle(ojdbc6.jar)

The below result of a test today with ojdbc6.jar in oracle database.      Connection con =null;       Statement stmt=null;       Connection  con =              DriverManager.getConnection( “jdbc:oracle:thin:@127.0.0.1:1521:test”, User,PW);             stmt = con.createStatement();             ResultSet rs = stmt.executeQuery("select * from table1");           // 1 CachedRowSet is ok.           CachedRowSet rowSet;           rowSet=new CachedRowSetImpl();           rowSet.populate(rs); // It work            //2 Jd...

log how to increase sqlplus column output length?

Met this issue again today, log here. http://stackoverflow.com/questions/7384789/how-to-increase-sqlplus-column-output-length Use cmd on Windows 7 Professional SQL> set long 50000;    //it's OK.

Review FreeMarker

//1. Create a configuration instance          Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);          cfg.setDirectoryForTemplateLoading(new File(" templates ")); //templates is the parallel of src          cfg.setDefaultEncoding("UTF-8");          cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); //2. Get the template          Template t1 = cfg.getTemplate(" a.ftl ");        //3.Create a data-model          Map<String, Object> rt = new HashMap<String, Object>();          rt.put("user","Jetma");          rt.put("random", Math.random()*100);               ...

defer vs async in script

图片
The blue line means loading times. Ref: segmentfault. com/ q / 1010000000640869

Getting Started with Underscore.js

http://www.sitepoint.com/getting-started-with-underscore-js/

Efficient SQL Statements in Oracle

1. not in A: SELECT col1,col2,col3 FROM table1 a WHERE a.col1 not in (SELECT col1 FROM table2) B:SELECT col1,col2,col3 FROM table1 a WHERE not exists (SELECT 'x' FROM table2 b WHERE a.col1=b.col1) B:  is better than A. a<>0  to->  a>0 or a<0 a<>''  to->  a>'' 2. not null a>0 or a>'' is better than a is not null. 3.>= replace > A: SELECT … FROM DEPARTMENT WHERE DEPT_CODE >=0; B: SELECT * FROM EMP WHERE DEPTNO >3 A is better than B. 4.LIKE name LIKE '%jeck%'  should be name LIKE 'Xjeck%' OR YY_BH LIKE 'Bjack%' 5.EXISTS v DISTINCT A: SELECT DISTINCT DEPT_NO,DEPT_NAME FROM DEPT D , EMP E WHERE D.DEPT_NO = E.DEPT_NO B: SELECT DEPT_NO,DEPT_NAME FROM DEPT D WHERE EXISTS (SELECT 'X' FROM EMP E WHERE E.DEPT_NO = D.DEPT_NO); B is better than A 6. page A: select *   from (select a.*, rownum as rnum           from (select * from table1) a  ...

Datepicker z-index issue?

http://jqueryui.com/download/ Ref: http://stackoverflow.com/questions/11533161/jquery-ui-datepicker-change-z-index Solution:     var date2 = $( "#end_date" ).datepicker({    defaultDate: new Date(),    changeMonth: true ,    numberOfMonths: 1,    minDate: lastYear,    dateFormat: 'yy-mm-dd' ,    beforeShow: function () {        setTimeout( function (){             $( '.ui-datepicker' ).css( 'z-index' , 99999999999999);        }, 0);    }  });