文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>【BO-SDK】-(RAS) DB_Connection Changing _@Z01

【BO-SDK】-(RAS) DB_Connection Changing _@Z01

时间:2010-09-24  来源:xiangjinling

DB_Connection with RAS (not customer con changing which can be done by boe sdk)

....


IInfoObjects oInfoObjects=null;
IInfoObject oInfoObject=null;

IEnterpriseSession boEnterpriseSession;
ReportClientDocument myClientDocument=null;
try {
boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon( username, password, cmsName, authType);
IInfoStore boInfoStore = (IInfoStore) boEnterpriseSession.getService("", "InfoStore");
oInfoObjects = (IInfoObjects) boInfoStore.query("Select * from CI_INFOOBJECTS Where SI_INSTANCE=0 And SI_ID='16578'");
oInfoObject = (IInfoObject) oInfoObjects.get(0);

IReportAppFactory myReportfactory=(IReportAppFactory)boEnterpriseSession.getService("RASReportFactory");
myClientDocument=myReportfactory.openDocument(oInfoObject, 0, Locale.getDefault()) ;
DatabaseController dbController=myClientDocument.getDatabaseController();

PropertyBag promptProperties = new PropertyBag();
promptProperties.putBooleanValue( PropertyBagHelper.PROMPTPROPERTY_ALL, true );
promptProperties.putBooleanValue( PropertyBagHelper.PROMPTPROPERTY_INCLUDEONDEMANDSUBREPORT, true );
promptProperties.putBooleanValue( PropertyBagHelper.PROMPTPROPERTY_INCLUDEMETADATASUBCONNECTIONS, true );
promptProperties.putBooleanValue( PropertyBagHelper.PROMPTPROPERTY_INCLUDEOLAPCONNECTIONS, true );
ConnectionInfos connectionInfos=dbController.getConnectionInfos(promptProperties);

IConnectionInfo oldConnection_=connectionInfos.getConnectionInfo(0);
//ConnectionInfos oConnectionInfos = new ConnectionInfos();
IConnectionInfo newIConnectionInfo = new ConnectionInfo();

newIConnectionInfo.setKind( ConnectionInfoKind.CRQE );
newIConnectionInfo.setUserName("user777");
newIConnectionInfo.setPassword("777");

PropertyBag attributes=newIConnectionInfo.getAttributes();
attributes.put( PropertyBagHelper.CONNINFO_DATABASE_DLL, "crdb_opensql");


PropertyBag logonPb = new PropertyBag();
logonPb.put("PreQEServerName", "myserver7.sap.corp");
logonPb.put("PreQEDatabaseName", "CLIENT=102 LANG=EN ASHOST="myserver7.sap.corp" SYSNR=04 R3NAME=EH4");
attributes.put(PropertyBagHelper.CONNINFO_CRQE_LOGONPROPERTIES, logonPb);
//attributes.put("QE_LogonProperties", logonPb);
//oConnectionInfos.add(oIConnectionInfo);
dbController.replaceConnection(oldConnection_, newIConnectionInfo, null, DBOptions._doNotVerifyDB);
//myClientDocument.verifyDatabase();

myClientDocument.save();

} catch (SDKException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ReportSDKException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

-----------------------------------------

IConnectionInfo oldConnection=connectionInfos.getConnectionInfo(0);
PropertyBag attrius=oldConnection.getAttributes();

attrius.get("QE_ServerDescription")...

QE_ServerDescription

QE_SQLDB

QE_DatabaseType

QE_DatabaseName

QE_LogonProperties

SSO Enabled

Database DLL

-------------------

PropertyBag logpb=(PropertyBag)attrius.get("QE_LogonProperties");

logpb.get("sap_selected_system")....

sap_selected_system

CODEPAGE

CLIENT

Database

LANG

SSOKEY

Server

SYSNR

ASHOST

------------------------------------------

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载