当前位置: 首页 > 工具软件 > OFBiz > 使用案例 >

Ofbiz使用原生Sql

訾渝
2023-12-01

Delegator delegator = (Delegator) request.getAttribute("delegator");
String groupHelperName= delegator.getGroupHelperName("org.ofbiz.olap");
GenericHelperInfo helperInfo=new GenericHelperInfo(null, groupHelperName);
SQLProcessor sql=new SQLProcessor(delegator, helperInfo);
try {
Connection conn= sql.getConnection();

} catch (GenericDataSourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (GenericEntityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

 类似资料: