/**
  * @param dataSourceStub JDataSourceStub
  * @return JConnection
  * @throws Exception
  */
 protected static JConnection createConnection(JDataSourceStub dataSourceStub) throws Exception {
   JConnection jconn = null;
   if (dataSourceStub.DBClass == null) {
     dataSourceStub.DBClass = Class.forName(dataSourceStub.classname);
   }
   if (dataSourceStub.NAClass == null) {
     dataSourceStub.NAClass = Class.forName(dataSourceStub.dbclass);
   }
   if (dataSourceStub.NAClass != null) {
     jconn = (JConnection) dataSourceStub.NAClass.newInstance();
   }
   if (jconn != null) jconn.setDataBaseType(dataSourceStub.DataBaseType);
   return jconn;
 }
 /**
  * @param ParamObject Object
  * @param DataObject Object
  * @param CustomObject Object
  * @param AddeitiveObject Object
  * @return Object
  */
 public Object InitObject(
     Object ParamObject, Object DataObject, Object CustomObject, Object AddeitiveObject) {
   // ��ȡ��ݿ����б�
   java.util.List dblist = PackageStub.getContentVector("databases");
   if (dblist == null) {
     return null;
   }
   StubObject SO = null;
   for (int i = 0; i < dblist.size(); i++) {
     SO = (StubObject) dblist.get(i);
     if (SO == null) {
       continue;
     }
     JDataSourceStub DSS = new JDataSourceStub();
     DSS.DataBaseType =
         SO.getString("id", null); // EAI.Registry.GetElementValue(DBElement,"DataBaseType");
     DSS.classname =
         SO.getString("class", null); // .Registry.GetElementValue(DBElement,"classname");
     DSS.dbclass =
         SO.getString("dbclass", null); // EAI.Registry.GetElementValue(DBElement,"dbclass");
     DBList.add(DSS);
   }
   return null;
 }
 /**
  * @param ParamObject Object
  * @param DataObject Object
  * @param CustomObject Object
  * @param AdditiveObject Object
  * @return Object
  * @throws Exception
  */
 public Object CheckDBDataSource(
     Object ParamObject, Object DataObject, Object CustomObject, Object AdditiveObject)
     throws Exception {
   JParamObject PO;
   String DBType;
   JDataSourceStub DSS;
   JConnection jconn = null;
   boolean hasDataSource = false;
   PO = (JParamObject) ParamObject;
   DBType = PO.GetValueByEnvName("DataBaseType");
   for (int i = 0; i < DBList.size(); i++) {
     DSS = (JDataSourceStub) DBList.get(i);
     if (DSS.DataBaseType.toLowerCase().equals(DBType.toLowerCase()) == true) {
       if (DSS.DBClass == null) {
         DSS.DBClass = Class.forName(DSS.classname);
       }
       if (DSS.NAClass == null) {
         DSS.NAClass = Class.forName(DSS.dbclass);
       }
       if (DSS.NAClass != null) {
         jconn = (JConnection) DSS.NAClass.newInstance();
         try {
           hasDataSource = lookDataSource(jconn, PO);
         } catch (Exception e) {
           e.printStackTrace();
         }
         if (hasDataSource) break;
       }
     }
   }
   if (!hasDataSource) {
     throw new Exception("ϵͳû���ṩ" + DBType + "������ݿ�������!");
   }
   if (hasDataSource) return jconn;
   return null;
 }