当前位置:Gxlcms > 数据库问题 > 多线程实现多数据库模拟连接

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

时间:2021-07-01 10:21:17 帮助过:29人阅读

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

 

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

标签:trace   try   sed   color   tac   seda   url   code   nbsp   

人气教程排行