多线程实现多数据库模拟连接

   while (true)


            {

                    Scanner scanner = new Scanner(System.in);
                    System.out.print("输入Url:");
                    String url = scanner.next();
                    Thread t1 = new Thread(new BaseDao(url), "zi");
                   // Thread t2 = new Thread(new BaseDao(url), "qw");
                  //  Thread t3 = new Thread(new BaseDao(url), "rrr");
                    try {

                        t1.start();
                        t1.join();
                      // t2.start();
                      //   t3.start();





                    } catch (Exception e) {
                        e.printStackTrace();
                    }
           
               // System.out.println(Thread.currentThread().getName() + " " + i);
            }

 

posted on 2017-07-09 09:00  wsad8546  阅读(86)  评论(0编辑  收藏  举报