WEB开发网
开发学院数据库DB2 雇员工作空间系列: 配置和开发 DB2 Content Manag... 阅读

雇员工作空间系列: 配置和开发 DB2 Content Manager 8.2 的单点登录 portlet

 2008-10-15 16:33:07 来源:WEB开发网   
核心提示: 为了使用 TConnect.java 中的新 connect() 方法,还需要修改 TListEntities.java 的 main() 函数,雇员工作空间系列: 配置和开发 DB2 Content Manager 8.2 的单点登录 portlet(7),下面是新的 main() 方法

为了使用 TConnect.java 中的新 connect() 方法,还需要修改 TListEntities.java 的 main() 函数。下面是新的 main() 方法的代码:

public static void main(String[] args) throws Exception {
 if (args.length < 3) {
  System.out.println(
   "Displays details on types of entities defined on the server. n"
     + "Syntax: n"
     + " java TListEntities <dstype> <server> <ltpaToken> [<entity>] n"
     + "where: n"
     + " <dstype> is the type of server (Fed, ICM, DL, OD, DB2) n"
     + " <server> is the name of the server or database. This can be n"
     + "      followed by a connect string in parenthesis. n"
     + " <ltpaToken> is the ltpaToken n"
     + " <entity> optional, the name of a particular entity. Detailed n"
     + "      information will be displayed about the entity. n"
     + "Examples: n"
     + " java TListEntities ICM icmnlsdb ltpaToken n"
     + " java TListEntities ICM icmnlsdb ltpaToken 'Document (for Document data model)' n"
     + " java TListEntities DL libsrvrn ltpaToken n"
     + " java TListEntities Fed cmbdb ltpaToken n"
     + " java TListEntities DB2 sample ltpaToken emp_photo n"
     + " java TListEntities OD odserver ltpaToekn n"
     + "where single quotes are used around entity and attribute names that contain spaces");
  System.exit(0);
 }
 String dstype = args[0];
 String server = args[1];
 String ltpaToken = args[2];
  
 String entity = null;
 int nextArg = 4;
 if (nextArg < args.length && args[nextArg] != null) {
  if (args[nextArg].startsWith("'"))
  {
   String arg = args[nextArg];
   while (nextArg <args.length && !arg.endsWith("'"))
   {
    nextArg++;
    arg += " "+args[nextArg];
   }
   entity = arg.substring(1,arg.length()-1);
  }
  else
   entity = args[nextArg];
 }
 CMBConnection connection = new CMBConnection();
 CMBSchemaManagement schemaManagement = connection.getSchemaManagement();
 schemaManagement.setChildComponentsAsAttributes(childComponentsAsAttributes);
 TConnect.connect(connection, dstype, server, ltpaToken);
 if (entity == null) {
  listEntities(schemaManagement);
 } else {
  printEntityDetails(schemaManagement.getEntity(entity), 1, true);
 }
 TConnect.disconnect(connection);
}

上一页  2 3 4 5 6 7 8 9  下一页

Tags:雇员 工作 空间

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接