jfinal druid使用oracle的設置

用oracle仍是有些坑,直接附上配置代碼,以避免再踩。oracle

參考這篇博客app

  
1 DruidPlugin druidPlugin = new DruidPlugin(url, user, pwd); 2 druidPlugin.setInitialSize( 3 ); 3 druidPlugin.setDriverClass( " oracle.jdbc.driver.OracleDriver " ); 4 druidPlugin.setValidationQuery( " select 1 from dual " ); 5 druidPlugin.setTestWhileIdle( true ); 6 druidPlugin.setTestOnBorrow( false ); 7 druidPlugin.setTestOnReturn( false ); 8 9 ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin); 10 11 arp.setContainerFactory( new CaseInsensitiveContainerFactory()); 12 arp.setDialect( new OracleDialect()); 13 14 15 // add mapping here 16 17 // start 18 druidPlugin.start(); 19 arp.start();
相關文章
相關標籤/搜索