首页 > 代码库 > 多线程实现多数据库模拟连接

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

   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);
            }

 

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