Java中路由器模式
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.Serializable;
import java.rmi.Naming;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class RunRouterPattern {
public static void main(String[] arguments) {
System.out.println("Example for the Router pattern");
System.out
.println("This code same will create a series of GUIs, and use");
System.out
.println(" the Router pattern to map message notifications between");
System.out
.println(" them. In this code example, the Router will send messages");
System.out
.println(" between the GUI clients based on the following mapping:");
System.out.println();
System.out.println("\tGUI # 1:\tGUI #2\tGUI #3");
System.out.println("\tGUI # 2:\tGUI #1\tGUI&nbs
相关文档:
正则表达式在字符串处理上有着强大的功能,sun在jdk1.4加入了对它的支持
下面简单的说下它的4种常用功能:
查询:
以下是代码片段:
String str="abc efg ABC";
String regEx="a|f"; //表示a或f
Pattern p=P ......
关键字: axis
由于没学习过.net
,最近程序中需要调用.net
的webservice
接口得到一张图片。在网上找了好多资料选用的axis来实现调用。
首先看看.net
实现Webmehod的两种方式,这两种方式java
传参数的方式也有不同
1.rpc方式:
Java
代码
using System;
using& ......
花了大半天的时间终于解决了问题,下面分享一下我的过程:
我的系统安装的是jdk6,netbeans和Mycrosoft SqlServer 2005,java连接数据库一般要分六部走
1.注册驱动
2.用驱动管理类创建连接
3.创建语句statement封装sql脚本语句
4.执行
5.处理返回的结果
6.关闭相关连接
在这里连接的是SqlServer2005,属于第三方驱动 ......