⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delbyzch1.java

📁 JAVA和DB2数据库操作小程序
💻 JAVA
字号:
package delByZch;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class DelByZCH1 {

	private Text text_1;
	private Text text_2;
	private Text text_4;

	protected Shell shell;
 
	public static void main(String[] args)
	{
		try 
		{
			DelByZCH1 window = new DelByZCH1();
			window.open();
			
		} 
		catch (Exception e) 
		{
			e.printStackTrace();
		}
	}
 
	public void open() 
	{
		final Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed())
		{
			if (!display.readAndDispatch())
				display.sleep();
		}
	}
 
	protected void createContents() {
		shell = new Shell(SWT.MIN | SWT.CLOSE);
		shell.setSize(557, 681);
		shell.setText("工商软件删除工具v1.1");
		
		final Group group_1 = new Group(shell, SWT.NONE);
		group_1.setBounds(10, 85, 495, 79);

		text_1 = new Text(group_1, SWT.BORDER);
		text_1.setTopIndex(1);
		text_1.setBounds(10, 49,474, 25);

		final Button button = new Button(group_1, SWT.NONE);
		button.setBounds(379, 13,82, 22);
		button.setText("提交");
		
		button.addSelectionListener(new SelectionAdapter() 
		{
			public void widgetSelected(SelectionEvent arg0) 
			{}
		});
		
		button.addMouseListener(new MouseAdapter() 
		{
			public void mouseDown(MouseEvent arg0) 
			{
				String insertSql = "";
				String insertSql2 = "";
				
				
				String[] inputStr = text_1.getText().split(",");
				
				for(int i =0;i < inputStr.length;i ++)
				{
					insertSql += "delete FROM topicis.DJ_QYMCYHZSHJL where QYMCYXHZ= " +
							"(select YHZMCBS from TOPICIS.Dj_zt where zch='"+ inputStr[i]+"'  " +
									"fetch first 1 rows only);" + "\n";
										
					insertSql += "commit;\n";
					
					insertSql2 += "delete FROM topicis.DJ_ZT  where bs = (select bs from TOPICIS.Dj_zt where zch='"+ inputStr[i]+"'  fetch first 1 rows only);" + "\n";
					
					insertSql2 += "commit;\n";
				}
				
				text_2.setText(insertSql);
				text_2.setSelection(text_2.getCharCount()); 
			
				
				text_4.setText(insertSql2);
				text_4.setSelection(text_4.getCharCount()); 
			}
		});

		final Group group = new Group(shell, SWT.NONE);
		group.setBounds(10, 170, 495, 479);

		final Label label_1 = new Label(group, SWT.NONE);
		label_1.setBounds(10, 21,206, 22);
		label_1.setText("一般附属表删除sql如下:");
		
		text_2 = new Text(group, SWT.V_SCROLL | SWT.MULTI);
		text_2.setBounds(10, 49,474, 344);
		text_2.setTopIndex(2);		
				
		final Label label_2 = new Label(group, SWT.NONE);
		label_2.setBounds(10, 399,206, 22);
		label_2.setText("主体信息删除sql如下:");
		
		text_4 = new Text(group, SWT.V_SCROLL | SWT.MULTI);
		text_4.setBounds(10, 427,474, 37);
		text_4.setTopIndex(4);
			
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -