protected static void initOracleDB() throws InstantiationException { if(oracleDB != null) return; synchronized(lock) { if(oracleDB != null) return; oracleDB = DBFactory.create("oracle"); } } public static void updateBLOB(Blob blob,File file) throws SQLException
public static void main(String[] args) { TestDBAdapter testdbadapter = new TestDBAdapter(); try { //根据日期获取不同数据库的日期转换函数,其中com.frameworkset.orm.adapter.DBFactory.DBOracle表示数据库类型常量 Date date = new Date(); System.out.println(com.frameworkset.orm.adapter.DBFactory.create(com.frameworkset.orm.adapter.DBFactory.DBOracle).getDateString(date)); //根据日期字符串获取不同数据库的日期转换函数,其中com.frameworkset.orm.adapter.DBFactory.DBOracle表示数据库类型常量 String date_str = "11-04-2006 09:27:31"; System.out.println(com.frameworkset.orm.adapter.DBFactory.create(com.frameworkset.orm.adapter.DBFactory.DBOracle).getDateString(date_str)); } catch (InstantiationException ex) { } }
private void _initAdaptor() { String dbtype = info.getDbtype(); String driver = info.getDriver(); if (dbtype == null) { try { log.debug("Init DBAdapter from driver:" + driver); dbAdapter = DBFactory.create(driver); } catch (InstantiationException ex) { log.error(ex.getMessage(),ex); } } else { try { log.debug("Init DBAdapter from dbtype:" + dbtype); dbAdapter = DBFactory.create(dbtype); } catch (InstantiationException ex1) { log.error(ex1.getMessage(),ex1); } } }