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


Java PreferenceInitializer.getJDBCDriverSettingList方法代码示例

本文整理汇总了Java中org.insightech.er.preference.PreferenceInitializer.getJDBCDriverSettingList方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceInitializer.getJDBCDriverSettingList方法的具体用法?Java PreferenceInitializer.getJDBCDriverSettingList怎么用?Java PreferenceInitializer.getJDBCDriverSettingList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.insightech.er.preference.PreferenceInitializer的用法示例。


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

示例1: setData

import org.insightech.er.preference.PreferenceInitializer; //导入方法依赖的package包/类
private void setData() {
    table.removeAll();

    for (final JDBCDriverSetting setting : PreferenceInitializer.getJDBCDriverSettingList()) {
        final TableItem tableItem = new TableItem(table, SWT.NONE);
        tableItem.setBackground(ColorConstants.white);
        tableItem.setText(0, Format.null2blank(setting.getDb()));
        tableItem.setText(1, Format.null2blank(setting.getClassName()));
        tableItem.setText(2, Format.null2blank(setting.getPath()));
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:12,代码来源:JDBCPreferencePage.java

示例2: setData

import org.insightech.er.preference.PreferenceInitializer; //导入方法依赖的package包/类
private void setData() {
	this.table.removeAll();

	for (JDBCDriverSetting setting : PreferenceInitializer
			.getJDBCDriverSettingList()) {
		TableItem tableItem = new TableItem(this.table, SWT.NONE);
		tableItem.setBackground(ColorConstants.white);
		tableItem.setText(0, Format.null2blank(setting.getDb()));
		tableItem.setText(1, Format.null2blank(setting.getClassName()));
		tableItem.setText(2, Format.null2blank(setting.getPath()));
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:13,代码来源:JDBCPreferencePage.java

示例3: getDriverClass

import org.insightech.er.preference.PreferenceInitializer; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Class<Driver> getDriverClass(final String driverClassName) {
    String path = null;
    Class clazz = null;

    try {
        if (driverClassName.equals("sun.jdbc.odbc.JdbcOdbcDriver")) {
            return (Class<Driver>) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

        } else {
            path = PreferenceInitializer.getJDBCDriverPath(getId(), driverClassName);

            // Cache the class loader to map.
            // Because if I use the another loader with the driver using
            // native library(.dll)
            // next error occur.
            //
            // java.lang.UnsatisfiedLinkError: Native Library xxx.dll
            // already loaded in another classloader
            //
            ClassLoader loader = loaderMap.get(path);
            if (loader == null) {
                loader = getClassLoader(path);
                loaderMap.put(path, loader);
            }

            clazz = loader.loadClass(driverClassName);
        }

    } catch (final Exception e) {
        final JDBCPathDialog dialog = new JDBCPathDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getId(), driverClassName, path, new ArrayList<JDBCDriverSetting>(), false);

        if (dialog.open() == IDialogConstants.OK_ID) {
            final JDBCDriverSetting newDriverSetting = new JDBCDriverSetting(getId(), dialog.getDriverClassName(), dialog.getPath());

            final List<JDBCDriverSetting> driverSettingList = PreferenceInitializer.getJDBCDriverSettingList();

            if (driverSettingList.contains(newDriverSetting)) {
                driverSettingList.remove(newDriverSetting);
            }
            driverSettingList.add(newDriverSetting);

            PreferenceInitializer.saveJDBCDriverSettingList(driverSettingList);

            clazz = getDriverClass(dialog.getDriverClassName());
        }
    }

    return clazz;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:52,代码来源:DBManagerBase.java

示例4: getDriverClass

import org.insightech.er.preference.PreferenceInitializer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Class<Driver> getDriverClass(String driverClassName) {
	String path = null;
	Class clazz = null;

	try {
		if (driverClassName.equals("sun.jdbc.odbc.JdbcOdbcDriver")) {
			return (Class<Driver>) Class
					.forName("sun.jdbc.odbc.JdbcOdbcDriver");

		} else {
			path = PreferenceInitializer.getJDBCDriverPath(this.getId(),
					driverClassName);

			// Cache the class loader to map.
			// Because if I use the another loader with the driver using
			// native library(.dll)
			// next error occur.
			//
			// java.lang.UnsatisfiedLinkError: Native Library xxx.dll
			// already loaded in another classloader
			//
			ClassLoader loader = this.loaderMap.get(path);
			if (loader == null) {
				loader = this.getClassLoader(path);
				this.loaderMap.put(path, loader);
			}

			clazz = loader.loadClass(driverClassName);
		}

	} catch (Exception e) {
		JDBCPathDialog dialog = new JDBCPathDialog(PlatformUI
				.getWorkbench().getActiveWorkbenchWindow().getShell(),
				this.getId(), driverClassName, path,
				new ArrayList<JDBCDriverSetting>(), false);

		if (dialog.open() == IDialogConstants.OK_ID) {
			JDBCDriverSetting newDriverSetting = new JDBCDriverSetting(
					this.getId(), dialog.getDriverClassName(),
					dialog.getPath());

			List<JDBCDriverSetting> driverSettingList = PreferenceInitializer
					.getJDBCDriverSettingList();

			if (driverSettingList.contains(newDriverSetting)) {
				driverSettingList.remove(newDriverSetting);
			}
			driverSettingList.add(newDriverSetting);

			PreferenceInitializer
					.saveJDBCDriverSettingList(driverSettingList);

			clazz = this.getDriverClass(dialog.getDriverClassName());
		}
	}

	return clazz;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:60,代码来源:DBManagerBase.java


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