当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionProfileConstants类代码示例

本文整理汇总了Java中org.eclipse.datatools.connectivity.ConnectionProfileConstants的典型用法代码示例。如果您正苦于以下问题:Java ConnectionProfileConstants类的具体用法?Java ConnectionProfileConstants怎么用?Java ConnectionProfileConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConnectionProfileConstants类属于org.eclipse.datatools.connectivity包,在下文中一共展示了ConnectionProfileConstants类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isTransientSampleDbProfile

import org.eclipse.datatools.connectivity.ConnectionProfileConstants; //导入依赖的package包/类
private static boolean isTransientSampleDbProfile( Properties dbProfileProps )
{
    String profileName =
        dbProfileProps.getProperty( ConnectionProfileProperty.PROFILE_NAME_PROP_KEY );
    if( profileName != null && profileName.length() > 0 )   // has profile name
        return false;   // not for a transient profile

    // check if the transient profile properties contain reference of
    // the default SampleDb driver definition instance
    String driverDefnId = dbProfileProps.getProperty(
            ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, null );
    if( driverDefnId == null ||
        ! ( driverDefnId.equalsIgnoreCase( SampleDbFactory.SAMPLEDB_DEFAULT_DRIVER_DEFN_ID ) ||
            driverDefnId.equalsIgnoreCase( SampleDbFactory.getLocalizedDriverDefinitionId() ) ))
        return false;

    String dbUrl = dbProfileProps.getProperty( IJDBCConnectionProfileConstants.URL_PROP_ID, null );
    if( dbUrl == null || 
            dbUrl.replace( '\\', '/' ).indexOf( SampleDbFactory.SAMPLEDB_URL_RELATIVE_SUFFIX ) == -1 )
        return false;

    return true;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:SampleDbPropertyProvider.java

示例2: createPropertiesByVendorVersion

import org.eclipse.datatools.connectivity.ConnectionProfileConstants; //导入依赖的package包/类
public static Properties createPropertiesByVendorVersion(String vendor, String version) {

		Properties properties = new Properties();
		for (TemplateDescriptor templateDescriptor : TemplateDescriptor.getDriverTemplateDescriptors()) {

			String templateVendor = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID);
			String templateVersion = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID);

			if (templateVendor != null && templateVendor.equals(vendor) && templateVersion != null && templateVersion.equals(version)) {

				if (!templateDescriptor.getId().endsWith(QCatalogContainer.TEMPLATE_SUFFIX))
					continue;

				properties.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, templateVendor);
				properties.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, templateVersion);

				// System.out.println(templateDescriptor.getId());
				DriverInstance driverInstances[] = DriverManager.getInstance().getDriverInstancesByTemplate(templateDescriptor.getId());
				if (driverInstances.length > 0)
					properties.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, driverInstances[0].getId());

				String driverClass = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID);
				if (driverClass != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driverClass);

				// platform dependent jar list
				StringBuffer jarList = new StringBuffer();
				try {
					Bundle bundle = Platform.getBundle(templateDescriptor.getElement().getDeclaringExtension().getNamespaceIdentifier());
					String paths[] = templateDescriptor.getJarList().split(";");
					for (int i = 0; i < paths.length; i++) {
						if (i > 0)
							jarList.append(System.getProperty("path.separator"));
						URL pathURL = bundle.getEntry(paths[i].trim());
						jarList.append(new Path(FileLocator.toFileURL(pathURL).getFile()).toOSString());
					}
				} catch (IOException e) {
					throw new FrameworkCoreRuntimeException(e);
				}

				properties.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, jarList.toString());

				String driverUrl = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.URL_PROP_ID);
				if (driverUrl != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, driverUrl);

				String user = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID);
				if (user != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, user);

				String password = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID);
				if (password != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, password);

				properties.setProperty(IJDBCConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, Boolean.FALSE.toString());

				break;
			}
		}

		return properties;

	}
 
开发者ID:asupdev,项目名称:asup,代码行数:64,代码来源:BaseCatalogHelper.java

示例3: createPropertiesByVendorVersion

import org.eclipse.datatools.connectivity.ConnectionProfileConstants; //导入依赖的package包/类
public Properties createPropertiesByVendorVersion(String vendor, String version) {

		Properties properties = new Properties();
		for (TemplateDescriptor templateDescriptor : TemplateDescriptor.getDriverTemplateDescriptors()) {

			String templateVendor = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID);
			String templateVersion = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID);

			if (templateVendor != null && templateVendor.equals(vendor) && templateVersion != null && templateVersion.equals(version)) {

				if (!templateDescriptor.getId().endsWith(QCatalogContainer.TEMPLATE_SUFFIX))
					continue;

				properties.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, templateVendor);
				properties.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, templateVersion);

				// System.out.println(templateDescriptor.getId());
				DriverInstance driverInstances[] = DriverManager.getInstance().getDriverInstancesByTemplate(templateDescriptor.getId());
				if (driverInstances.length > 0)
					properties.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, driverInstances[0].getId());

				String driverClass = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID);
				if (driverClass != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, driverClass);

				// platform dependent jar list
				StringBuffer jarList = new StringBuffer();
				try {
					Bundle bundle = Platform.getBundle(templateDescriptor.getElement().getDeclaringExtension().getNamespaceIdentifier());
					String paths[] = templateDescriptor.getJarList().split(";");
					for (int i = 0; i < paths.length; i++) {
						if (i > 0)
							jarList.append(System.getProperty("path.separator"));
						URL pathURL = bundle.getEntry(paths[i].trim());
						jarList.append(new Path(FileLocator.toFileURL(pathURL).getFile()).toOSString());
					}
				} catch (IOException e) {
					throw new FrameworkCoreRuntimeException(e);
				}

				properties.setProperty(IDriverMgmtConstants.PROP_DEFN_JARLIST, jarList.toString());

				String driverUrl = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.URL_PROP_ID);
				if (driverUrl != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, driverUrl);

				String user = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID);
				if (user != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, user);

				String password = templateDescriptor.getPropertyValueFromId(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID);
				if (password != null)
					properties.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, password);

				properties.setProperty(IJDBCConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, Boolean.FALSE.toString());

				break;
			}
		}

		return properties;

	}
 
开发者ID:asupdev,项目名称:asup,代码行数:64,代码来源:ASUPPlugin.java


注:本文中的org.eclipse.datatools.connectivity.ConnectionProfileConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。