本文整理汇总了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()));
}
}
示例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()));
}
}
示例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;
}
示例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;
}