提交 68c85ec1 编写于 作者: S serge-rider

Oracle 12+ driver version update (ojdbc8)

上级 dad86ddb
......@@ -16,13 +16,11 @@
*/
package org.jkiss.dbeaver.core;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.*;
......@@ -36,15 +34,20 @@ import org.jkiss.dbeaver.model.DBPDataSource;
import org.jkiss.dbeaver.model.DBPErrorAssistant;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.access.DBAAuthInfo;
import org.jkiss.dbeaver.model.access.DBAPasswordChangeInfo;
import org.jkiss.dbeaver.model.runtime.*;
import org.jkiss.dbeaver.runtime.DummyRunnableContext;
import org.jkiss.dbeaver.runtime.RunnableContextDelegate;
import org.jkiss.dbeaver.runtime.ui.DBPPlatformUI;
import org.jkiss.dbeaver.runtime.ui.DBUserInterface;
import org.jkiss.dbeaver.ui.*;
import org.jkiss.dbeaver.ui.AbstractUIJob;
import org.jkiss.dbeaver.ui.SharedTextColors;
import org.jkiss.dbeaver.ui.TrayIconHandler;
import org.jkiss.dbeaver.ui.UITask;
import org.jkiss.dbeaver.ui.actions.datasource.DataSourceInvalidateHandler;
import org.jkiss.dbeaver.ui.dialogs.StandardErrorDialog;
import org.jkiss.dbeaver.ui.dialogs.connection.BaseAuthDialog;
import org.jkiss.dbeaver.ui.dialogs.connection.PasswordChangeDialog;
import org.jkiss.dbeaver.ui.dialogs.driver.DriverEditDialog;
import org.jkiss.dbeaver.ui.views.process.ProcessPropertyTester;
import org.jkiss.dbeaver.ui.views.process.ShellProcessView;
......@@ -97,13 +100,8 @@ public class DBeaverUI implements DBPPlatformUI {
boolean cancelable,
final DBRRunnableWithProgress runnableWithProgress)
throws InvocationTargetException, InterruptedException {
runnableContext.run(fork, cancelable, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
runnableWithProgress.run(RuntimeUtils.makeMonitor(monitor));
}
});
runnableContext.run(fork, cancelable,
monitor -> runnableWithProgress.run(RuntimeUtils.makeMonitor(monitor)));
}
private void dispose() {
......@@ -226,12 +224,7 @@ public class DBeaverUI implements DBPPlatformUI {
if (workbench != null && workbench.getActiveWorkbenchWindow() != null) {
return new RunnableContextDelegate(workbench.getActiveWorkbenchWindow());
} else {
return new DBRRunnableContext() {
@Override
public void run(boolean fork, boolean cancelable, DBRRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
runnable.run(new VoidProgressMonitor());
}
};
return (fork, cancelable, runnable) -> runnable.run(new VoidProgressMonitor());
}
}
......@@ -241,13 +234,7 @@ public class DBeaverUI implements DBPPlatformUI {
*/
public static void runInProgressService(final DBRRunnableWithProgress runnable)
throws InvocationTargetException, InterruptedException {
getDefaultRunnableContext().run(true, true, new DBRRunnableWithProgress() {
@Override
public void run(DBRProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
runnable.run(monitor);
}
});
getDefaultRunnableContext().run(true, true, runnable::run);
}
/**
......@@ -264,13 +251,7 @@ public class DBeaverUI implements DBPPlatformUI {
} else {
runnableContext = workbench.getProgressService();
}
runnableContext.run(true, true, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
runnable.run(RuntimeUtils.makeMonitor(monitor));
}
});
runnableContext.run(true, true, monitor -> runnable.run(RuntimeUtils.makeMonitor(monitor)));
} catch (InterruptedException e) {
// do nothing
}
......@@ -278,13 +259,8 @@ public class DBeaverUI implements DBPPlatformUI {
public static void runInUI(IRunnableContext context, final DBRRunnableWithProgress runnable) {
try {
PlatformUI.getWorkbench().getProgressService().runInUI(context, new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
runnable.run(RuntimeUtils.makeMonitor(monitor));
}
}, DBeaverActivator.getWorkspace().getRoot());
PlatformUI.getWorkbench().getProgressService().runInUI(context,
monitor -> runnable.run(RuntimeUtils.makeMonitor(monitor)), DBeaverActivator.getWorkspace().getRoot());
} catch (InvocationTargetException e) {
DBUserInterface.getInstance().showError(null, null, e.getTargetException());
} catch (InterruptedException e) {
......@@ -351,15 +327,11 @@ public class DBeaverUI implements DBPPlatformUI {
}
}
// log.debug(message);
Runnable runnable = new Runnable() {
@Override
public void run()
{
// Display the dialog
StandardErrorDialog dialog = new StandardErrorDialog(DBeaverUI.getActiveWorkbenchShell(),
title, message, RuntimeUtils.stripStack(status), IStatus.ERROR);
dialog.open();
}
Runnable runnable = () -> {
// Display the dialog
StandardErrorDialog dialog = new StandardErrorDialog(DBeaverUI.getActiveWorkbenchShell(),
title, message, RuntimeUtils.stripStack(status), IStatus.ERROR);
dialog.open();
};
DBeaverUI.syncExec(runnable);
return UserResponse.OK;
......@@ -419,6 +391,23 @@ public class DBeaverUI implements DBPPlatformUI {
}.execute();
}
@Override
public DBAPasswordChangeInfo promptUserPasswordChange(String prompt, String userName, String oldPassword) {
// Ask user
return new UITask<DBAPasswordChangeInfo>() {
@Override
public DBAPasswordChangeInfo runTask() {
final Shell shell = DBeaverUI.getActiveWorkbenchShell();
final PasswordChangeDialog passwordChangeDialog = new PasswordChangeDialog(shell, prompt, userName, oldPassword);
if (passwordChangeDialog.open() == IDialogConstants.OK_ID) {
return passwordChangeDialog.getPasswordInfo();
} else {
return null;
}
}
}.execute();
}
@Override
public void executeProcess(final DBRProcessDescriptor processDescriptor) {
processDescriptor.setProcessListener(new DBRProcessListener() {
......@@ -439,20 +428,17 @@ public class DBeaverUI implements DBPPlatformUI {
showError("Execute process", processDescriptor.getName(), e);
}
if (processDescriptor.getCommand().isShowProcessPanel()) {
asyncExec(new Runnable() {
@Override
public void run() {
try {
final ShellProcessView processView =
(ShellProcessView) DBeaverUI.getActiveWorkbenchWindow().getActivePage().showView(
ShellProcessView.VIEW_ID,
ShellProcessView.getNextId(),
IWorkbenchPage.VIEW_VISIBLE
);
processView.initProcess(processDescriptor);
} catch (PartInitException e) {
log.error(e);
}
asyncExec(() -> {
try {
final ShellProcessView processView =
(ShellProcessView) DBeaverUI.getActiveWorkbenchWindow().getActivePage().showView(
ShellProcessView.VIEW_ID,
ShellProcessView.getNextId(),
IWorkbenchPage.VIEW_VISIBLE
);
processView.initProcess(processDescriptor);
} catch (PartInitException e) {
log.error(e);
}
});
}
......
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ui.dialogs.connection;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
import org.jkiss.dbeaver.core.CoreMessages;
import org.jkiss.dbeaver.model.DBIcon;
import org.jkiss.dbeaver.model.access.DBAPasswordChangeInfo;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.dialogs.BaseDialog;
import org.jkiss.utils.CommonUtils;
/**
* Password change dialog
*/
public class PasswordChangeDialog extends BaseDialog
{
private DBAPasswordChangeInfo passwordInfo;
private String verifyText;
public PasswordChangeDialog(Shell parentShell, String title, String userName, String oldPassword)
{
super(parentShell, title, DBIcon.TREE_USER);
this.passwordInfo = new DBAPasswordChangeInfo(userName, oldPassword);
}
public DBAPasswordChangeInfo getPasswordInfo()
{
return passwordInfo;
}
@Override
protected Composite createDialogArea(Composite parent)
{
Composite credGroup = super.createDialogArea(parent);
((GridLayout)credGroup.getLayout()).numColumns = 2;
CLabel infoLabel = UIUtils.createInfoLabel(credGroup, getTitle());
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
infoLabel.setLayoutData(gd);
Text userNameText = UIUtils.createLabelText(credGroup, "User Name", passwordInfo.getUserName(), SWT.BORDER);
userNameText.addModifyListener(e -> passwordInfo.setUserName(userNameText.getText()));
Text oldPasswordText = UIUtils.createLabelText(credGroup, "Old Password", passwordInfo.getOldPassword(), SWT.BORDER | SWT.PASSWORD);
oldPasswordText.addModifyListener(e -> passwordInfo.setOldPassword(oldPasswordText.getText()));
Text newPasswordText = UIUtils.createLabelText(credGroup, "New Password", "", SWT.BORDER | SWT.PASSWORD);
newPasswordText.addModifyListener(e -> {
passwordInfo.setNewPassword(newPasswordText.getText());
updateButtons();
});
Text verifyPasswordText = UIUtils.createLabelText(credGroup, "Verify Password", "", SWT.BORDER | SWT.PASSWORD);
verifyPasswordText.addModifyListener(e -> {
verifyText = verifyPasswordText.getText();
updateButtons();
});
return credGroup;
}
private void updateButtons() {
getButton(IDialogConstants.OK_ID).setEnabled(
!CommonUtils.isEmpty(passwordInfo.getUserName()) &&
CommonUtils.equalObjects(passwordInfo.getNewPassword(), verifyText));
}
}
......@@ -290,7 +290,7 @@
<file name="xdb6.jar" optional="true" description="SQLXML support"/>
</fileSource>
<fileSource url="http://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html" name="Oracle 12c drivers">
<file name="ojdbc7.jar" description="JDBC driver"/>
<file name="ojdbc8.jar" description="JDBC driver"/>
<file name="orai18n.jar" optional="true" description="NLS classes"/>
<file name="xdb6.jar" optional="true" description="SQLXML support"/>
</fileSource>
......@@ -299,9 +299,9 @@
</fileSource>
<file type="license" path="drivers/oracle/LICENSE.txt" bundle="drivers.oracle"/>
<file type="jar" path="drivers/oracle/ojdbc6.jar" bundle="drivers.oracle"/>
<file type="jar" path="drivers/oracle/ojdbc8.jar" bundle="drivers.oracle"/>
<file type="jar" path="drivers/oracle/orai18n.jar" bundle="drivers.oracle"/>
<file type="jar" path="drivers/oracle/xdb.jar" bundle="drivers.oracle"/>
<file type="jar" path="drivers/oracle/xdb6.jar" bundle="drivers.oracle"/>
<file type="jar" path="drivers/oracle/xmlparserv2.jar" bundle="drivers.oracle"/>
</driver>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册