博文

目前显示的是 三月, 2016的博文

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 JdbcRowSet is not ok. Don't know why? //          JdbcRowSet  rowSet = new JdbcRowSetImpl(rs); // It doesn't work           rs.close();           stmt.close();           con.close();

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);                  List<String> list = new ArrayList<String>();          list.add("sss");          list.add("s02");          rt.put("lst",list);                  rt.put("date1", new Date());          rt.put("html1", "<h1>H1</h1>");